diff options
author | Junio C Hamano <gitster@pobox.com> | 2013-07-22 22:23:24 +0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-07-22 22:23:24 +0400 |
commit | 8827a58cf0ac7bee4ac8d357236975ead9783df3 (patch) | |
tree | c3fde5879274f79dfdb4b8c04f10776d4753070e | |
parent | fbf59cdb4f804aec3ddf5e30ef0012e98d61fbd6 (diff) | |
parent | ace33bf991f8f6643e58a3642962ed244ba36b5b (diff) |
Merge branch 'dw/request-pull-diag'
* dw/request-pull-diag:
request-pull: improve error message for invalid revision args
-rwxr-xr-x | git-request-pull.sh | 14 |
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" |