summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
Diffstat (limited to 't')
-rwxr-xr-xt/t1500-rev-parse.sh15
1 files changed, 15 insertions, 0 deletions
diff --git a/t/t1500-rev-parse.sh b/t/t1500-rev-parse.sh
index bf2a90df94..58a4583088 100755
--- a/t/t1500-rev-parse.sh
+++ b/t/t1500-rev-parse.sh
@@ -309,4 +309,19 @@ test_expect_success '--short= truncates to the actual hash length' '
test_cmp expect actual
'
+test_expect_success ':/ and HEAD^{/} favor more recent matching commits' '
+ test_when_finished "rm -rf repo" &&
+ git init repo &&
+ (
+ cd repo &&
+ test_commit common-old &&
+ test_commit --no-tag common-new &&
+ git rev-parse HEAD >expect &&
+ git rev-parse :/common >actual &&
+ test_cmp expect actual &&
+ git rev-parse HEAD^{/common} >actual &&
+ test_cmp expect actual
+ )
+'
+
test_done