+11
-2
status.go
+11
-2
status.go
···
1
1
package git
2
2
3
-
import "fmt"
4
-
import "bytes"
3
+
import (
4
+
"bytes"
5
+
"fmt"
6
+
"path/filepath"
7
+
)
5
8
6
9
// Status represents the current status of a Worktree.
7
10
// The key of the map is the path of the file.
···
15
18
}
16
19
17
20
return s[path]
21
+
}
22
+
23
+
// IsUntracked checks if file for given path is 'Untracked'
24
+
func (s Status) IsUntracked(path string) bool {
25
+
stat, ok := (s)[filepath.ToSlash(path)]
26
+
return ok && stat.Worktree == Untracked
18
27
}
19
28
20
29
// IsClean returns true if all the files aren't in Unmodified status.
+1
-3
worktree.go
+1
-3
worktree.go