Skip to contentSkip to conversation

git-revert: Fix die before git-sh-setup defines it.

PATCH New Bob Proulx 1 participant 1 message Jun 15, 2016

lore
Share & tools
lore

Bob Proulx

author
#0 lore raw

PATCH 1/1 git-revert: Fix die before git-sh-setup defines it.

The code previously checked it's own name and called 'die' upon an error. However 'die' was not yet defined because git-sh-setup had not been sourced yet. Instead simply write the error message to stderr and exit with an error as was originally desired.

---

I found this by inspection. I contemplated several different ways of resolving it but in the end the simplest seemed to be the best.

 git-revert.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
git-revert.sh +1 -1
index 50cc47b..5ca894a 100755
@@ -16,7 +16,7 @@ case "$0" in
 	me=cherry-pick
 	USAGE='[--edit] [-n] [-r] [-x] <commit-ish>'  ;;
 * )
-	die "What are you talking about?" ;;
+	echo "What are you talking about?" 1>&2 ; exit 1 ;;
 esac
 . git-sh-setup
 
Signature · 1 line
1.4.0