Skip to content

Commit

Permalink
fix isGitRepo by using rev-parse --is-inside-work-tree. closes #99
Browse files Browse the repository at this point in the history
  • Loading branch information
chriswalz committed Mar 1, 2021
1 parent e596818 commit 2b5e578
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions cmd/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,8 @@ func IsAheadOfCurrent() bool {
}

func IsGitRepo() bool {
_, err := execCommand("git", "status").CombinedOutput()
if err != nil {
return false
}
return true
out, _ := execCommand("git", "rev-parse", "--is-inside-work-tree").CombinedOutput()
return strings.TrimSpace(string(out)) == "true"
}

func IsBehindCurrent() bool {
Expand Down

0 comments on commit 2b5e578

Please sign in to comment.