Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.

Commit 8827a58

Browse files
committed
Merge branch 'dw/request-pull-diag'
* dw/request-pull-diag: request-pull: improve error message for invalid revision args
2 parents fbf59cd + ace33bf commit 8827a58

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

git-request-pull.sh

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,18 @@ fi
5151
tag_name=$(git describe --exact "$head^0" 2>/dev/null)
5252

5353
test -n "$base" && test -n "$url" || usage
54-
baserev=$(git rev-parse --verify "$base"^0) &&
55-
headrev=$(git rev-parse --verify "$head"^0) || exit
54+
55+
baserev=$(git rev-parse --verify --quiet "$base"^0)
56+
if test -z "$baserev"
57+
then
58+
die "fatal: Not a valid revision: $base"
59+
fi
60+
61+
headrev=$(git rev-parse --verify --quiet "$head"^0)
62+
if test -z "$headrev"
63+
then
64+
die "fatal: Not a valid revision: $head"
65+
fi
5666

5767
merge_base=$(git merge-base $baserev $headrev) ||
5868
die "fatal: No commits in common between $base and $head"

0 commit comments

Comments
 (0)