Skip to content

Commit 2b5e578

Browse files
committed
fix isGitRepo by using rev-parse --is-inside-work-tree. closes #99
1 parent e596818 commit 2b5e578

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

cmd/git.go

+2-5
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,8 @@ func IsAheadOfCurrent() bool {
3636
}
3737

3838
func IsGitRepo() bool {
39-
_, err := execCommand("git", "status").CombinedOutput()
40-
if err != nil {
41-
return false
42-
}
43-
return true
39+
out, _ := execCommand("git", "rev-parse", "--is-inside-work-tree").CombinedOutput()
40+
return strings.TrimSpace(string(out)) == "true"
4441
}
4542

4643
func IsBehindCurrent() bool {

0 commit comments

Comments
 (0)