3 test_description
='diff --relative tests'
6 test_expect_success
'setup' '
7 git commit --allow-empty -m empty &&
10 echo other content >subdir/file2 &&
21 diff --git a/$expect b/$expect
23 index 0000000..25c05ef
29 test_expect_success
"-p $*" "
30 git -C '$dir' diff -p $* HEAD^ >actual &&
31 test_cmp expected actual
43 test_expect_success
"--numstat $*" "
44 echo '1 0 $expect' >expected &&
45 git -C '$dir' diff --numstat $* HEAD^ >actual &&
46 test_cmp expected actual
57 1 file changed, 1 insertion(+)
59 test_expect_success
"--stat $*" "
60 git -C '$dir' diff --stat $* HEAD^ >actual &&
61 test_i18ncmp expected actual
71 :000000 100644 0000000000000000000000000000000000000000 25c05ef3639d2d270e7fe765a67668f098092bc5 A $expect
73 test_expect_success
"--raw $*" "
74 git -C '$dir' diff --no-abbrev --raw $* HEAD^ >actual &&
75 test_cmp expected actual
79 for type in diff numstat stat raw
81 check_
$type . file2
--relative=subdir
/
82 check_
$type . file2
--relative=subdir
83 check_
$type subdir file2
--relative
84 check_
$type . dir
/file2
--relative=sub