Skip to content

Commit

Permalink
rev-parse: A and B in "rev-parse A..B" refer to committish
Browse files Browse the repository at this point in the history
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Junio C Hamano committed Jul 9, 2012
1 parent 13243c2 commit c036c4c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions builtin/rev-parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ static int try_difference(const char *arg)
next = "HEAD";
if (dotdot == arg)
this = "HEAD";
if (!get_sha1(this, sha1) && !get_sha1(next, end)) {
if (!get_sha1_committish(this, sha1) && !get_sha1_committish(next, end)) {
show_rev(NORMAL, end, next);
show_rev(symmetric ? NORMAL : REVERSED, sha1, this);
if (symmetric) {
Expand Down Expand Up @@ -278,7 +278,7 @@ static int try_parent_shorthands(const char *arg)
return 0;

*dotdot = 0;
if (get_sha1(arg, sha1))
if (get_sha1_committish(arg, sha1))
return 0;

if (!parents_only)
Expand Down
2 changes: 1 addition & 1 deletion t/t1512-rev-parse-disambiguation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ test_expect_success 'log name1..name2 takes only commit-ishes on both ends' '
git log 000000000...
'

test_expect_failure 'rev-parse name1..name2 takes only commit-ishes on both ends' '
test_expect_success 'rev-parse name1..name2 takes only commit-ishes on both ends' '
git rev-parse 000000000..000000000 &&
git rev-parse ..000000000 &&
git rev-parse 000000000..
Expand Down

0 comments on commit c036c4c

Please sign in to comment.