diff options
author | Stefan Haller <stefan@haller-berlin.de> | 2024-03-25 14:41:51 +0100 |
---|---|---|
committer | Stefan Haller <stefan@haller-berlin.de> | 2024-03-28 13:11:08 +0100 |
commit | 93251db67e013a7ab675af07ba437d7a71bd6c79 (patch) | |
tree | 4eda1e80d6a26aba30d22f1ecc9cd55667274175 /pkg/commands | |
parent | de52a68b53a9c74c205d4f785ae6db0c5bb5d26d (diff) |
Fix the "Add to .git/info/exclude" command in submodules or worktrees
Diffstat (limited to 'pkg/commands')
-rw-r--r-- | pkg/commands/git_commands/working_tree.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/pkg/commands/git_commands/working_tree.go b/pkg/commands/git_commands/working_tree.go index 99665d7cc..c3338650a 100644 --- a/pkg/commands/git_commands/working_tree.go +++ b/pkg/commands/git_commands/working_tree.go @@ -3,6 +3,7 @@ package git_commands import ( "fmt" "os" + "path" "github.com/go-errors/errors" "github.com/jesseduffield/lazygit/pkg/commands/models" @@ -232,7 +233,8 @@ func (self *WorkingTreeCommands) Ignore(filename string) error { // Exclude adds a file to the .git/info/exclude for the repo func (self *WorkingTreeCommands) Exclude(filename string) error { - return self.os.AppendLineToFile(".git/info/exclude", filename) + excludeFile := path.Join(self.repoPaths.repoGitDirPath, "info", "exclude") + return self.os.AppendLineToFile(excludeFile, filename) } // WorktreeFileDiff returns the diff of a file |