summaryrefslogtreecommitdiff
path: root/git-request-pull.sh
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2013-07-22 11:23:24 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2013-07-22 11:23:24 -0700
commit8827a58cf0ac7bee4ac8d357236975ead9783df3 (patch)
treec3fde5879274f79dfdb4b8c04f10776d4753070e /git-request-pull.sh
parentMerge branch 'jc/mailmap-case-insensitivity' (diff)
parentrequest-pull: improve error message for invalid revision args (diff)
downloadtgif-8827a58cf0ac7bee4ac8d357236975ead9783df3.tar.xz
Merge branch 'dw/request-pull-diag'
* dw/request-pull-diag: request-pull: improve error message for invalid revision args
Diffstat (limited to 'git-request-pull.sh')
-rwxr-xr-xgit-request-pull.sh14
1 files changed, 12 insertions, 2 deletions
diff --git a/git-request-pull.sh b/git-request-pull.sh
index d566015975..ebf1269d29 100755
--- a/git-request-pull.sh
+++ b/git-request-pull.sh
@@ -51,8 +51,18 @@ fi
tag_name=$(git describe --exact "$head^0" 2>/dev/null)
test -n "$base" && test -n "$url" || usage
-baserev=$(git rev-parse --verify "$base"^0) &&
-headrev=$(git rev-parse --verify "$head"^0) || exit
+
+baserev=$(git rev-parse --verify --quiet "$base"^0)
+if test -z "$baserev"
+then
+ die "fatal: Not a valid revision: $base"
+fi
+
+headrev=$(git rev-parse --verify --quiet "$head"^0)
+if test -z "$headrev"
+then
+ die "fatal: Not a valid revision: $head"
+fi
merge_base=$(git merge-base $baserev $headrev) ||
die "fatal: No commits in common between $base and $head"