Merge branch 'nd/http-fetch-shallow-fix' into maint
[gitweb.git] / t / t4056-diff-order.sh
index c39ec4121a997bf92220f663616a4422ab608d01..9e2b29ede508e3d0822f5eb607db2ae4896611e6 100755 (executable)
@@ -57,12 +57,44 @@ test_expect_success "no order (=tree object order)" '
        test_cmp expect_none actual
 '
 
+test_expect_success 'missing orderfile' '
+       rm -f bogus_file &&
+       test_must_fail git diff -Obogus_file --name-only HEAD^..HEAD
+'
+
+test_expect_success POSIXPERM,SANITY 'unreadable orderfile' '
+       >unreadable_file &&
+       chmod -r unreadable_file &&
+       test_must_fail git diff -Ounreadable_file --name-only HEAD^..HEAD
+'
+
 for i in 1 2
 do
        test_expect_success "orderfile using option ($i)" '
                git diff -Oorder_file_$i --name-only HEAD^..HEAD >actual &&
                test_cmp expect_$i actual
        '
+
+       test_expect_success PIPE "orderfile is fifo ($i)" '
+               rm -f order_fifo &&
+               mkfifo order_fifo &&
+               {
+                       cat order_file_$i >order_fifo &
+               } &&
+               git diff -O order_fifo --name-only HEAD^..HEAD >actual &&
+               wait &&
+               test_cmp expect_$i actual
+       '
+
+       test_expect_success "orderfile using config ($i)" '
+               git -c diff.orderfile=order_file_$i diff --name-only HEAD^..HEAD >actual &&
+               test_cmp expect_$i actual
+       '
+
+       test_expect_success "cancelling configured orderfile ($i)" '
+               git -c diff.orderfile=order_file_$i diff -O/dev/null --name-only HEAD^..HEAD >actual &&
+               test_cmp expect_none actual
+       '
 done
 
 test_done