aboutsummaryrefslogtreecommitdiffstats
path: root/worktree.go
diff options
context:
space:
mode:
authorkuba-- <kuba@sourced.tech>2018-08-29 14:56:25 +0200
committerkuba-- <kuba@sourced.tech>2018-08-29 14:56:25 +0200
commit75fa41d21c8d27ee0d5d7c7cb7ceeb2b765be330 (patch)
tree79b51316a608a848f60360fd76f1ca671c471579 /worktree.go
parent0167dabb78412ed5fb76cb4b174a6708c3be52b8 (diff)
downloadgo-git-75fa41d21c8d27ee0d5d7c7cb7ceeb2b765be330.tar.gz
Add Status.IsUntracked function
Signed-off-by: kuba-- <kuba@sourced.tech>
Diffstat (limited to 'worktree.go')
-rw-r--r--worktree.go4
1 files changed, 1 insertions, 3 deletions
diff --git a/worktree.go b/worktree.go
index 921e600..e45d815 100644
--- a/worktree.go
+++ b/worktree.go
@@ -750,9 +750,7 @@ func (w *Worktree) doClean(status Status, opts *CleanOptions, dir string, files
return err
}
} else {
- // check if file is 'Untracked'
- s, ok := (status)[filepath.ToSlash(path)]
- if ok && s.Worktree == Untracked {
+ if status.IsUntracked(path) {
if err := w.Filesystem.Remove(path); err != nil {
return err
}