aboutsummaryrefslogtreecommitdiffstats
path: root/worktree_status.go
diff options
context:
space:
mode:
authorOleg Sklyar <oleg.sklyar@profidatagroup.com>2017-06-20 17:18:59 +0200
committerOleg Sklyar <oleg.sklyar@profidatagroup.com>2017-06-20 17:18:59 +0200
commitdcdd9a70179b14d01c985c93ea0af717f4d88979 (patch)
tree5dd14804017d0a8ea0d87bff42e646e2fac9ebeb /worktree_status.go
parent65bf694a758c768488685fff6b2c275f4bfe6b87 (diff)
downloadgo-git-dcdd9a70179b14d01c985c93ea0af717f4d88979.tar.gz
Fixes gitignore ignored on checkout
Diffstat (limited to 'worktree_status.go')
-rw-r--r--worktree_status.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/worktree_status.go b/worktree_status.go
index 7116445..728d7a0 100644
--- a/worktree_status.go
+++ b/worktree_status.go
@@ -68,8 +68,6 @@ func (w *Worktree) status(commit plumbing.Hash) (Status, error) {
return nil, err
}
- right = w.excludeIgnoredChanges(right)
-
for _, ch := range right {
a, err := ch.Action()
if err != nil {
@@ -117,7 +115,11 @@ func (w *Worktree) diffStagingWithWorktree() (merkletrie.Changes, error) {
}
to := filesystem.NewRootNode(w.fs, submodules)
- return merkletrie.DiffTree(from, to, diffTreeIsEquals)
+ res, err := merkletrie.DiffTree(from, to, diffTreeIsEquals)
+ if err == nil {
+ res = w.excludeIgnoredChanges(res)
+ }
+ return res, err
}
func (w *Worktree) excludeIgnoredChanges(changes merkletrie.Changes) merkletrie.Changes {