summaryrefslogtreecommitdiff
path: root/git-resolve-script
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2005-08-20 08:21:21 (GMT)
committerJunio C Hamano <junkio@cox.net>2005-08-20 08:21:21 (GMT)
commit165e160e4c4fb5b03146d5c41c2f6b078260b098 (patch)
treebb63e003f160f4db9505f5b4540ebaf7c44ff8cd /git-resolve-script
parentb779dd5ee38d103c74e15a7c361f78f1025a0872 (diff)
downloadgit-165e160e4c4fb5b03146d5c41c2f6b078260b098.zip
git-165e160e4c4fb5b03146d5c41c2f6b078260b098.tar.gz
git-165e160e4c4fb5b03146d5c41c2f6b078260b098.tar.bz2
git-resolve: dying is good, not showing help is bad.
Recent change to make sure we get commit, not tag, accidentally removed its feature of giving a usage help message when it died. Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'git-resolve-script')
-rwxr-xr-xgit-resolve-script12
1 files changed, 8 insertions, 4 deletions
diff --git a/git-resolve-script b/git-resolve-script
index 4641119..50d5f83 100755
--- a/git-resolve-script
+++ b/git-resolve-script
@@ -6,21 +6,25 @@
#
. git-sh-setup-script || die "Not a git archive"
-head=$(git-rev-parse --verify "$1"^0) || exit
-merge=$(git-rev-parse --verify "$2"^0) || exit
-merge_msg="$3"
+usage () {
+ die "git-resolve-script <head> <remote> <merge-message>"
+}
dropheads() {
rm -f -- "$GIT_DIR/MERGE_HEAD" \
"$GIT_DIR/LAST_MERGE" || exit 1
}
+head=$(git-rev-parse --verify "$1"^0) &&
+merge=$(git-rev-parse --verify "$2"^0) &&
+merge_msg="$3" || usage
+
#
# The remote name is just used for the message,
# but we do want it.
#
if [ -z "$head" -o -z "$merge" -o -z "$merge_msg" ]; then
- die "git-resolve-script <head> <remote> <merge-message>"
+ usage
fi
dropheads