Skip to content

Commit 165e160

Browse files
author
Junio C Hamano
committed
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>
1 parent b779dd5 commit 165e160

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

git-resolve-script

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,25 @@
66
#
77
. git-sh-setup-script || die "Not a git archive"
88

9-
head=$(git-rev-parse --verify "$1"^0) || exit
10-
merge=$(git-rev-parse --verify "$2"^0) || exit
11-
merge_msg="$3"
9+
usage () {
10+
die "git-resolve-script <head> <remote> <merge-message>"
11+
}
1212

1313
dropheads() {
1414
rm -f -- "$GIT_DIR/MERGE_HEAD" \
1515
"$GIT_DIR/LAST_MERGE" || exit 1
1616
}
1717

18+
head=$(git-rev-parse --verify "$1"^0) &&
19+
merge=$(git-rev-parse --verify "$2"^0) &&
20+
merge_msg="$3" || usage
21+
1822
#
1923
# The remote name is just used for the message,
2024
# but we do want it.
2125
#
2226
if [ -z "$head" -o -z "$merge" -o -z "$merge_msg" ]; then
23-
die "git-resolve-script <head> <remote> <merge-message>"
27+
usage
2428
fi
2529

2630
dropheads

0 commit comments

Comments
 (0)