3 test_description
='test unique sha1 abbreviation on "index from..to" line'
6 test_expect_success
'setup' '
7 test_oid_cache <<-EOF &&
14 hash1 sha1:51d2738463ea4ca66f8691c91e33ce64b7d41bb1
15 hash1 sha256:ae31dfff0af93b2c62b0098a039b38569c43b0a7e97b873000ca42d128f27350
18 hasht1 sha256:ae31dfff
20 hash2 sha1:51d2738efb4ad8a1e40bed839ab8e116f0a15e47
21 hash2 sha256:ae31dffada88a46fd5f53c7ed5aa25a7a8951f1d5e88456c317c8d5484d263e5
24 hasht2 sha256:ae31dffa
27 cat >expect_initial <<-EOF &&
28 100644 blob $(test_oid hash1) foo
31 cat >expect_update <<-EOF &&
32 100644 blob $(test_oid hash2) foo
35 echo "$(test_oid val1)" > foo &&
37 git commit -m "initial" &&
38 git cat-file -p HEAD: > actual &&
39 test_cmp expect_initial actual &&
40 echo "$(test_oid val2)" > foo &&
41 git commit -a -m "update" &&
42 git cat-file -p HEAD: > actual &&
43 test_cmp expect_update actual
47 index $(test_oid hasht1)..$(test_oid hasht2) 100644
50 test_expect_success
'diff does not produce ambiguous index line' '
51 git diff HEAD^..HEAD | grep index > actual &&
52 test_cmp expect actual