From 329106c8455e84030283e9e62a1c968494b1c224 Mon Sep 17 00:00:00 2001 From: Nicolai Skogheim Date: Sat, 25 Jul 2015 03:16:18 +0200 Subject: [PATCH] effort: don't count untouched files --- bin/git-effort | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/bin/git-effort b/bin/git-effort index 0f5d243..6c8f823 100755 --- a/bin/git-effort +++ b/bin/git-effort @@ -62,6 +62,13 @@ effort() { local commit_dates commit_dates=`dates $file` [ $? -gt 0 ] && exit 255 + + # Ensure it's not just an empty line + if [ -z "`head -c 1 <<<$(echo $commit_dates)`" ] + then + exit 0 + fi + commits=`wc -l <<<"$(echo "$commit_dates")"` color='90'