diff options
Diffstat (limited to 'worktree.go')
-rw-r--r-- | worktree.go | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/worktree.go b/worktree.go index 1de17c8..ab11d42 100644 --- a/worktree.go +++ b/worktree.go @@ -865,11 +865,10 @@ func (w *Worktree) Clean(opts *CleanOptions) error { if err != nil { return err } - m := gitignore.NewMatcher([]gitignore.Pattern{}) return w.doClean(s, opts, root, files) } -func (w *Worktree) doClean(status Status, matcher gitignore.Matcher, opts *CleanOptions, dir string, files []os.FileInfo) error { +func (w *Worktree) doClean(status Status, opts *CleanOptions, dir string, files []os.FileInfo) error { for _, fi := range files { if fi.Name() == GitDirName { continue @@ -886,12 +885,12 @@ func (w *Worktree) doClean(status Status, matcher gitignore.Matcher, opts *Clean if err != nil { return err } - err = w.doClean(status, matcher, opts, path, subfiles) + err = w.doClean(status, opts, path, subfiles) if err != nil { return err } } else { - if status.IsUntracked(path) || (opts.All && matcher.Match(strings.Split(path, string(os.PathSeparator)), false)) { + if status.IsUntracked(path) { if err := w.Filesystem.Remove(path); err != nil { return err } |