diff options
author | John Pastore <cbbm142@users.noreply.github.com> | 2023-03-21 09:15:32 -0400 |
---|---|---|
committer | John Pastore <cbbm142@users.noreply.github.com> | 2023-05-01 20:02:58 -0400 |
commit | cf51e2febf37332f11ae63feca768d9672e10a36 (patch) | |
tree | 29d29ca56d5b85b68f64bc88476e7876fa291be3 /worktree_status.go | |
parent | 3f1cfde283c93f33218c807602e93d47f72f7b90 (diff) | |
download | go-git-cf51e2febf37332f11ae63feca768d9672e10a36.tar.gz |
Worktree: Status, add check to see if file already checked in [Fixes 718]
Checks if an ignored file was previously checked in. If it was, then the file is not ignored matching native git behavior.
Diffstat (limited to 'worktree_status.go')
-rw-r--r-- | worktree_status.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/worktree_status.go b/worktree_status.go index f3091cf..a26c9e5 100644 --- a/worktree_status.go +++ b/worktree_status.go @@ -169,7 +169,9 @@ func (w *Worktree) excludeIgnoredChanges(changes merkletrie.Changes) merkletrie. if len(path) != 0 { isDir := (len(ch.To) > 0 && ch.To.IsDir()) || (len(ch.From) > 0 && ch.From.IsDir()) if m.Match(path, isDir) { - continue + if len(ch.From) == 0 { + continue + } } } res = append(res, ch) |