From f1fef21f839e88b081a1a938e97aea93c1c25350 Mon Sep 17 00:00:00 2001 From: Alexander Popov Date: Sat, 13 Aug 2022 12:37:44 +0300 Subject: [PATCH] check ".git" dir --- src/git-ahead-check.cr | 4 ++++ 1 file changed, 4 insertions(+) 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