[PATCH v5 24/25] rev-parse: A and B in "rev-parse A..B" refer to committish

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Junio C Hamano <gitster@xxxxxxxxx>
---
 builtin/rev-parse.c                 | 4 ++--
 t/t1512-rev-parse-disambiguation.sh | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/builtin/rev-parse.c b/builtin/rev-parse.c
index 98d1cbe..16b98b5 100644
--- a/builtin/rev-parse.c
+++ b/builtin/rev-parse.c
@@ -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) {
@@ -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)
diff --git a/t/t1512-rev-parse-disambiguation.sh b/t/t1512-rev-parse-disambiguation.sh
index c3b78b9..9acaf1d 100755
--- a/t/t1512-rev-parse-disambiguation.sh
+++ b/t/t1512-rev-parse-disambiguation.sh
@@ -111,7 +111,7 @@ test_expect_success 'log name1..name2 takes only commit-ishes on both ends' '
 	git log 11021982...
 '
 
-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 11021982..11021982 &&
 	git rev-parse ..11021982 &&
 	git rev-parse 11021982..
-- 
1.7.11.1.229.g706c98f

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]