t / t4022-diff-rewrite.shon commit Merge branch 'nd/maint-hide-checkout-index-from-error' into maint (5b57076)
   1#!/bin/sh
   2
   3test_description='rewrite diff'
   4
   5. ./test-lib.sh
   6
   7test_expect_success setup '
   8
   9        cat "$TEST_DIRECTORY"/../COPYING >test &&
  10        git add test &&
  11        tr \
  12          "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" \
  13          "nopqrstuvwxyzabcdefghijklmNOPQRSTUVWXYZABCDEFGHIJKLM" \
  14          <"$TEST_DIRECTORY"/../COPYING >test
  15
  16'
  17
  18test_expect_success 'detect rewrite' '
  19
  20        actual=$(git diff-files -B --summary test) &&
  21        expr "$actual" : " rewrite test ([0-9]*%)$" || {
  22                echo "Eh? <<$actual>>"
  23                false
  24        }
  25
  26'
  27
  28test_done
  29