update go git from v4.10.0 to v4.11.0 (#7096)

This commit is contained in:
Lunny Xiao 2019-06-01 03:34:46 +08:00 committed by zeripath
parent fb4438a815
commit 8a343dda39
15 changed files with 93 additions and 40 deletions

View file

@ -142,12 +142,16 @@ func (w *Worktree) diffStagingWithWorktree(reverse bool) (merkletrie.Changes, er
func (w *Worktree) excludeIgnoredChanges(changes merkletrie.Changes) merkletrie.Changes {
patterns, err := gitignore.ReadPatterns(w.Filesystem, nil)
if err != nil || len(patterns) == 0 {
if err != nil {
return changes
}
patterns = append(patterns, w.Excludes...)
if len(patterns) == 0 {
return changes
}
m := gitignore.NewMatcher(patterns)
var res merkletrie.Changes