diff --git a/bin/git-authors.sh b/bin/git-authors.sh index 3383558..709dacb 100755 --- a/bin/git-authors.sh +++ b/bin/git-authors.sh @@ -1,5 +1,8 @@ #!/bin/sh +# Enforce being in a git repository +git rev-parse --is-inside-work-tree >/dev/null || exit $? + # save as i.e.: git-authors and set the executable flag git ls-tree -r -z --name-only HEAD -- "${1}" \ | xargs -0 -n1 git blame --line-porcelain HEAD \ @@ -7,4 +10,3 @@ git ls-tree -r -z --name-only HEAD -- "${1}" \ | sort \ | uniq -c \ | sort -nr -