diff --git a/src/git-ahead-check.cr b/src/git-ahead-check.cr index 7dd8261..f3abe06 100644 --- a/src/git-ahead-check.cr +++ b/src/git-ahead-check.cr @@ -21,6 +21,10 @@ def check_repo(repo_path : String) return 0 end + if !Dir.exists?("#{repo_path}/.git") + return 0 + end + repo_name = repo_path.split("/")[-1] ahead_count = `git -C #{repo_path} status | grep -i "Your branch" | grep -Eo "[0-9]"`.chomp