Skip to content

Commit

Permalink
cmds: improve support for "git worktree" repositories when ignoring f…
Browse files Browse the repository at this point in the history
…iles

Ensure that we use the linked repository path when adding files to the local
.git/info/exclude path.

Closes: #1394
Reported-by: David Bold @dschwoerer on github
Signed-off-by: David Aguilar <davvid@gmail.com>
  • Loading branch information
davvid committed Apr 11, 2024
1 parent 8b2aebe commit 7bc9a03
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ Usability, bells and whistles

Fixes
-----
* The "Ignore" action in the Status context menu now supports adding to the local
`.git/info/exclude` when using linked repositories created using `git worktree`.
(`#1394 <https://github.com/git-cola/git-cola/issues/1394>`_)

* The `Cmd-m` hotkey on macOS will now minimize the application. The "Amend" action
can now be accessed using `Alt-m`.
(`#1390 <https://github.com/git-cola/git-cola/issues/1390>`_)
Expand Down
2 changes: 1 addition & 1 deletion cola/cmds.py
Original file line number Diff line number Diff line change
Expand Up @@ -869,7 +869,7 @@ def do(self):
new_additions = '\n'.join(self.filenames) + '\n'
for_status = new_additions
if self.local:
filename = os.path.join('.git', 'info', 'exclude')
filename = self.git.git_path('info', 'exclude')
else:
filename = '.gitignore'
if core.exists(filename):
Expand Down

0 comments on commit 7bc9a03

Please sign in to comment.