3 test_description='test unique sha1 abbreviation on "index from..to" line'
6 if ! test_have_prereq SHA1
8 skip_all='not using SHA-1 for objects'
12 cat >expect_initial <<EOF
13 100644 blob 51d2738463ea4ca66f8691c91e33ce64b7d41bb1 foo
16 cat >expect_update <<EOF
17 100644 blob 51d2738efb4ad8a1e40bed839ab8e116f0a15e47 foo
20 test_expect_success 'setup' '
23 git commit -m "initial" &&
24 git cat-file -p HEAD: > actual &&
25 test_cmp expect_initial actual &&
27 git commit -a -m "update" &&
28 git cat-file -p HEAD: > actual &&
29 test_cmp expect_update actual
33 index 51d27384..51d2738e 100644
36 test_expect_success 'diff does not produce ambiguous index line' '
37 git diff HEAD^..HEAD | grep index > actual &&
38 test_cmp expect actual