Skip to content
This repository was archived by the owner on Sep 11, 2020. It is now read-only.

Commit dcdd9a7

Browse files
author
Oleg Sklyar
committed
Fixes gitignore ignored on checkout
1 parent 65bf694 commit dcdd9a7

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

worktree_status.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,6 @@ func (w *Worktree) status(commit plumbing.Hash) (Status, error) {
6868
return nil, err
6969
}
7070

71-
right = w.excludeIgnoredChanges(right)
72-
7371
for _, ch := range right {
7472
a, err := ch.Action()
7573
if err != nil {
@@ -117,7 +115,11 @@ func (w *Worktree) diffStagingWithWorktree() (merkletrie.Changes, error) {
117115
}
118116

119117
to := filesystem.NewRootNode(w.fs, submodules)
120-
return merkletrie.DiffTree(from, to, diffTreeIsEquals)
118+
res, err := merkletrie.DiffTree(from, to, diffTreeIsEquals)
119+
if err == nil {
120+
res = w.excludeIgnoredChanges(res)
121+
}
122+
return res, err
121123
}
122124

123125
func (w *Worktree) excludeIgnoredChanges(changes merkletrie.Changes) merkletrie.Changes {

0 commit comments

Comments
 (0)