t / t4044-diff-index-unique-abbrev.shon commit git_config_set: reuse empty sections (c71d8bb)
   1#!/bin/sh
   2
   3test_description='test unique sha1 abbreviation on "index from..to" line'
   4. ./test-lib.sh
   5
   6cat >expect_initial <<EOF
   7100644 blob 51d2738463ea4ca66f8691c91e33ce64b7d41bb1    foo
   8EOF
   9
  10cat >expect_update <<EOF
  11100644 blob 51d2738efb4ad8a1e40bed839ab8e116f0a15e47    foo
  12EOF
  13
  14test_expect_success 'setup' '
  15        echo 4827 > foo &&
  16        git add foo &&
  17        git commit -m "initial" &&
  18        git cat-file -p HEAD: > actual &&
  19        test_cmp expect_initial actual &&
  20        echo 11742 > foo &&
  21        git commit -a -m "update" &&
  22        git cat-file -p HEAD: > actual &&
  23        test_cmp expect_update actual
  24'
  25
  26cat >expect <<EOF
  27index 51d27384..51d2738e 100644
  28EOF
  29
  30test_expect_success 'diff does not produce ambiguous index line' '
  31        git diff HEAD^..HEAD | grep index > actual &&
  32        test_cmp expect actual
  33'
  34
  35test_done