Skip to content

Commit c036c4c

Browse files
committed
rev-parse: A and B in "rev-parse A..B" refer to committish
Signed-off-by: Junio C Hamano <[email protected]>
1 parent 13243c2 commit c036c4c

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

builtin/rev-parse.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ static int try_difference(const char *arg)
238238
next = "HEAD";
239239
if (dotdot == arg)
240240
this = "HEAD";
241-
if (!get_sha1(this, sha1) && !get_sha1(next, end)) {
241+
if (!get_sha1_committish(this, sha1) && !get_sha1_committish(next, end)) {
242242
show_rev(NORMAL, end, next);
243243
show_rev(symmetric ? NORMAL : REVERSED, sha1, this);
244244
if (symmetric) {
@@ -278,7 +278,7 @@ static int try_parent_shorthands(const char *arg)
278278
return 0;
279279

280280
*dotdot = 0;
281-
if (get_sha1(arg, sha1))
281+
if (get_sha1_committish(arg, sha1))
282282
return 0;
283283

284284
if (!parents_only)

t/t1512-rev-parse-disambiguation.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ test_expect_success 'log name1..name2 takes only commit-ishes on both ends' '
111111
git log 000000000...
112112
'
113113

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' '
115115
git rev-parse 000000000..000000000 &&
116116
git rev-parse ..000000000 &&
117117
git rev-parse 000000000..

0 commit comments

Comments
 (0)