aboutsummaryrefslogtreecommitdiffstats
path: root/worktree_status.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2017-06-21 11:17:04 -0700
committerGitHub <noreply@github.com>2017-06-21 11:17:04 -0700
commitad02bf020460c210660db4fffda7f926b6aae95a (patch)
tree60423e7f3ab29530f1a61865abf55a6320200897 /worktree_status.go
parent4046ad933a32567c2267f05a972202b8c7cd92d0 (diff)
parent81dbc6a6e5cf5278ba3be981247fd702d5102cef (diff)
downloadgo-git-ad02bf020460c210660db4fffda7f926b6aae95a.tar.gz
Merge pull request #444 from silvertern/gitignore-ch2v4.0.0-rc11
Fixes checkout not possible with (untracked) files under gitignore
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 {