From 057caf389da8603d39749fcc6feb04fc106e136c Mon Sep 17 00:00:00 2001 From: Andrew Huss Date: Sat, 28 Jan 2017 15:53:55 -0800 Subject: [PATCH] Exit if we are not in a git repo --- git-quick-stats | 3 +++ 1 file changed, 3 insertions(+) diff --git a/git-quick-stats b/git-quick-stats index dafc0bb..5b0154f 100755 --- a/git-quick-stats +++ b/git-quick-stats @@ -180,6 +180,9 @@ function changelogs() { git log --pretty=format:"- %s%n%b" --since="$(git show -s --format=%ad `git rev-list --all --max-count=1`)" | sort -nr } +# Check if we are currently in a git repo. +git rev-parse --is-inside-work-tree > /dev/null + if [ $# -eq 1 ] then case $1 in