mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-12-01 21:44:23 +01:00
1 parent
8eb28cbb4c
commit
fad98cbde2
216 files changed
+27523
-3828
No files matched your search
+11
-2
@@ -1,7 +1,10 @@
|
||||
package git
|
||||
|
||||
import "fmt"
|
||||
import "bytes"
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"path/filepath"
|
||||
)
|
||||
|
||||
// Status represents the current status of a Worktree.
|
||||
// The key of the map is the path of the file.
|
||||
@@ -17,6 +20,12 @@ func (s Status) File(path string) *FileStatus {
|
||||
return s[path]
|
||||
}
|
||||
|
||||
// IsUntracked checks if file for given path is 'Untracked'
|
||||
func (s Status) IsUntracked(path string) bool {
|
||||
stat, ok := (s)[filepath.ToSlash(path)]
|
||||
return ok && stat.Worktree == Untracked
|
||||
}
|
||||
|
||||
// IsClean returns true if all the files aren't in Unmodified status.
|
||||
func (s Status) IsClean() bool {
|
||||
for _, status := range s {
|
||||
|
||||
Reference in new issue
Block a user