From: Linus Torvalds Date: Wed, 25 Jan 2006 22:02:10 GMT Subject: git-whatchanged: exit out early on errors Message-ID: In-Reply-To: If we get an error parsing the arguments, exit. Signed-off-by: Linus Torvalds --- This goes together with the previous diff - it just makes git-whatchanged exit gracefully when git-rev-parse errors out. diff --git a/git-whatchanged.sh b/git-whatchanged.sh index 80e2500..d4f985b 100755 --- a/git-whatchanged.sh +++ b/git-whatchanged.sh @@ -4,7 +4,7 @@ USAGE='[-p] [--max-count=] [.. SUBDIRECTORY_OK='Yes' . git-sh-setup -diff_tree_flags=$(git-rev-parse --sq --no-revs --flags "$@") +diff_tree_flags=$(git-rev-parse --sq --no-revs --flags "$@") || exit test -z "$diff_tree_flags" && diff_tree_flags=$(git-repo-config --get whatchanged.difftree) test -z "$diff_tree_flags" &&