3 test_description
='diff order'
10 echo "$1" >c
/Makefile
&&
12 git add a.h b.c c
/Makefile d.txt
&&
16 test_expect_success
'setup' '
21 cat >order_file_1 <<-\EOF &&
27 cat >order_file_2 <<-\EOF &&
33 cat >expect_none <<-\EOF &&
40 cat >expect_1 <<-\EOF &&
55 test_expect_success
"no order (=tree object order)" '
56 git diff --name-only HEAD^..HEAD >actual &&
57 test_cmp expect_none actual
60 test_expect_success
'missing orderfile' '
62 test_must_fail git diff -Obogus_file --name-only HEAD^..HEAD
65 test_expect_success POSIXPERM
,SANITY
'unreadable orderfile' '
67 chmod -r unreadable_file &&
68 test_must_fail git diff -Ounreadable_file --name-only HEAD^..HEAD
71 test_expect_success
"orderfile using option from subdir with --output" '
73 git -C subdir diff -O../order_file_1 --output ../actual --name-only HEAD^..HEAD &&
74 test_cmp expect_1 actual
79 test_expect_success
"orderfile using option ($i)" '
80 git diff -Oorder_file_$i --name-only HEAD^..HEAD >actual &&
81 test_cmp expect_$i actual
84 test_expect_success PIPE
"orderfile is fifo ($i)" '
88 cat order_file_$i >order_fifo &
90 git diff -O order_fifo --name-only HEAD^..HEAD >actual &&
92 test_cmp expect_$i actual
95 test_expect_success
"orderfile using config ($i)" '
96 git -c diff.orderfile=order_file_$i diff --name-only HEAD^..HEAD >actual &&
97 test_cmp expect_$i actual
100 test_expect_success
"cancelling configured orderfile ($i)" '
101 git -c diff.orderfile=order_file_$i diff -O/dev/null --name-only HEAD^..HEAD >actual &&
102 test_cmp expect_none actual
106 test_expect_success
'setup for testing combine-diff order' '
107 git checkout -b tmp HEAD~ &&
109 git checkout master &&
110 git merge --no-commit -s ours tmp &&
114 test_expect_success
"combine-diff: no order (=tree object order)" '
115 git diff --name-only HEAD HEAD^ HEAD^2 >actual &&
116 test_cmp expect_none actual
121 test_expect_success
"combine-diff: orderfile using option ($i)" '
122 git diff -Oorder_file_$i --name-only HEAD HEAD^ HEAD^2 >actual &&
123 test_cmp expect_$i actual