From bf0d56e7f2ce9b6538fb8a75fbdc2bcea1bc2995 Mon Sep 17 00:00:00 2001 From: Fabian Sabau Date: Thu, 21 Feb 2019 16:32:45 +0100 Subject: worktree: enable manual ignore patterns when no .gitignore is available Signed-off-by: Fabian Sabau --- worktree_status.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/worktree_status.go b/worktree_status.go index 0e113d0..16ce937 100644 --- a/worktree_status.go +++ b/worktree_status.go @@ -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 -- cgit