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

Commit

Permalink
worktree: enable manual ignore patterns when no .gitignore is available
Browse files Browse the repository at this point in the history
Signed-off-by: Fabian Sabau <[email protected]>
  • Loading branch information
fbsb committed Feb 21, 2019
1 parent db6c41c commit 2ecc89d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion worktree_status.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2ecc89d

Please sign in to comment.