rev-parse: A and B in "rev-parse A..B" refer to committish
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano committed
Jul 3, 2012 at 13:45 UTC
c036c4c5e426cc7ee8070038607edf06ef1d661e
2 files changed
+3
-3
builtin/rev-parse.c
+2
-2
@@ -238,7 +238,7 @@ static int try_difference(const char *arg)
238
next = "HEAD";
239
if (dotdot == arg)
240
this = "HEAD";
241
- if (!get_sha1(this, sha1) && !get_sha1(next, end)) {
241
+ if (!get_sha1_committish(this, sha1) && !get_sha1_committish(next, end)) {
242
show_rev(NORMAL, end, next);
243
show_rev(symmetric ? NORMAL : REVERSED, sha1, this);
244
if (symmetric) {
@@ -278,7 +278,7 @@ static int try_parent_shorthands(const char *arg)
278
return 0;
279
280
*dotdot = 0;
281
- if (get_sha1(arg, sha1))
281
+ if (get_sha1_committish(arg, sha1))
282
return 0;
283
284
if (!parents_only)
t/t1512-rev-parse-disambiguation.sh
+1
-1
@@ -111,7 +111,7 @@ test_expect_success 'log name1..name2 takes only commit-ishes on both ends' '
111
git log 000000000...
112
'
113
114
-test_expect_failure 'rev-parse name1..name2 takes only commit-ishes on both ends' '
114
+test_expect_success 'rev-parse name1..name2 takes only commit-ishes on both ends' '
115
git rev-parse 000000000..000000000 &&
116
git rev-parse ..000000000 &&
117
git rev-parse 000000000..