(command.CommandList children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:test_description) op: assign_op.Equal rhs: {(SQ <'diff order'>)} spids: [4] ) ] ) (C {<.>} {<'./test-lib.sh'>}) (command.ShFunction name: create_files body: (BraceGroup children: [ (command.AndOr ops: [Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp] children: [ (command.Simple words: [{<echo>} {(DQ ($ Id.VSub_Number '$1'))}] redirects: [(redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<a.h>})] do_fork: T ) (command.Simple words: [{<echo>} {(DQ ($ Id.VSub_Number '$1'))}] redirects: [(redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<b.c>})] do_fork: T ) (command.Simple words: [{<echo>} {(DQ ($ Id.VSub_Number '$1'))}] redirects: [ (redir op: <Id.Redir_Great '>'> loc: (redir_loc.Fd fd:1) arg: {<'c/Makefile'>} ) ] do_fork: T ) (command.Simple words: [{<echo>} {(DQ ($ Id.VSub_Number '$1'))}] redirects: [(redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<d.txt>})] do_fork: T ) (C {<git>} {<add>} {<a.h>} {<b.c>} {<'c/Makefile'>} {<d.txt>}) (C {<git>} {<commit>} {<-m> (DQ ($ Id.VSub_Number '$1'))}) ] ) ] ) ) (C {<test_expect_success>} {(SQ <setup>)} { (SQ <'\n'> <'\tmkdir c &&\n'> <'\tcreate_files 1 &&\n'> <'\tcreate_files 2 &&\n'> <'\n'> <'\tcat >order_file_1 <<-\\EOF &&\n'> <'\t*Makefile\n'> <'\t*.txt\n'> <'\t*.h\n'> <'\tEOF\n'> <'\n'> <'\tcat >order_file_2 <<-\\EOF &&\n'> <'\t*Makefile\n'> <'\t*.h\n'> <'\t*.c\n'> <'\tEOF\n'> <'\n'> <'\tcat >expect_none <<-\\EOF &&\n'> <'\ta.h\n'> <'\tb.c\n'> <'\tc/Makefile\n'> <'\td.txt\n'> <'\tEOF\n'> <'\n'> <'\tcat >expect_1 <<-\\EOF &&\n'> <'\tc/Makefile\n'> <'\td.txt\n'> <'\ta.h\n'> <'\tb.c\n'> <'\tEOF\n'> <'\n'> <'\tcat >expect_2 <<-\\EOF\n'> <'\tc/Makefile\n'> <'\ta.h\n'> <'\tb.c\n'> <'\td.txt\n'> <'\tEOF\n'> ) } ) (C {<test_expect_success>} {(DQ <'no order (=tree object order)'>)} { (SQ <'\n'> <'\tgit diff --name-only HEAD^..HEAD >actual &&\n'> <'\ttest_cmp expect_none actual\n'> ) } ) (C {<test_expect_success>} {(SQ <'missing orderfile'>)} { (SQ <'\n'> <'\trm -f bogus_file &&\n'> <'\ttest_must_fail git diff -Obogus_file --name-only HEAD^..HEAD\n'> ) } ) (C {<test_expect_success>} {<POSIXPERM> <Id.Lit_Comma ','> <SANITY>} {(SQ <'unreadable orderfile'>)} { (SQ <'\n'> <'\t>unreadable_file &&\n'> <'\tchmod -r unreadable_file &&\n'> <'\ttest_must_fail git diff -Ounreadable_file --name-only HEAD^..HEAD\n'> ) } ) (C {<test_expect_success>} {(DQ <'orderfile using option from subdir with --output'>)} { (SQ <'\n'> <'\tmkdir subdir &&\n'> <'\tgit -C subdir diff -O../order_file_1 --output ../actual --name-only HEAD^..HEAD &&\n'> <'\ttest_cmp expect_1 actual\n'> ) } ) (command.ForEach iter_names: [i] iterable: (for_iter.Words words:[{<1>} {<2>}]) body: (command.DoGroup children: [ (C {<test_expect_success>} {(DQ <'orderfile using option ('> ($ Id.VSub_DollarName '$i') <')'>)} { (SQ <'\n'> <'\t\tgit diff -Oorder_file_$i --name-only HEAD^..HEAD >actual &&\n'> <'\t\ttest_cmp expect_$i actual\n'> <'\t'> ) } ) (C {<test_expect_success>} {<PIPE>} {(DQ <'orderfile is fifo ('> ($ Id.VSub_DollarName '$i') <')'>)} { (SQ <'\n'> <'\t\trm -f order_fifo &&\n'> <'\t\tmkfifo order_fifo &&\n'> <'\t\t{\n'> <'\t\t\tcat order_file_$i >order_fifo &\n'> <'\t\t} &&\n'> <'\t\tgit diff -O order_fifo --name-only HEAD^..HEAD >actual &&\n'> <'\t\twait &&\n'> <'\t\ttest_cmp expect_$i actual\n'> <'\t'> ) } ) (C {<test_expect_success>} {(DQ <'orderfile using config ('> ($ Id.VSub_DollarName '$i') <')'>)} { (SQ <'\n'> < '\t\tgit -c diff.orderfile=order_file_$i diff --name-only HEAD^..HEAD >actual &&\n' > <'\t\ttest_cmp expect_$i actual\n'> <'\t'> ) } ) (C {<test_expect_success>} {(DQ <'cancelling configured orderfile ('> ($ Id.VSub_DollarName '$i') <')'>)} { (SQ <'\n'> < '\t\tgit -c diff.orderfile=order_file_$i diff -O/dev/null --name-only HEAD^..HEAD >actual &&\n' > <'\t\ttest_cmp expect_none actual\n'> <'\t'> ) } ) ] ) ) (C {<test_expect_success>} {(SQ <'setup for testing combine-diff order'>)} { (SQ <'\n'> <'\tgit checkout -b tmp HEAD~ &&\n'> <'\tcreate_files 3 &&\n'> <'\tgit checkout master &&\n'> <'\tgit merge --no-commit -s ours tmp &&\n'> <'\tcreate_files 5\n'> ) } ) (C {<test_expect_success>} {(DQ <'combine-diff: no order (=tree object order)'>)} { (SQ <'\n'> <'\tgit diff --name-only HEAD HEAD^ HEAD^2 >actual &&\n'> <'\ttest_cmp expect_none actual\n'> ) } ) (command.ForEach iter_names: [i] iterable: (for_iter.Words words:[{<1>} {<2>}]) body: (command.DoGroup children: [ (C {<test_expect_success>} {(DQ <'combine-diff: orderfile using option ('> ($ Id.VSub_DollarName '$i') <')'>)} { (SQ <'\n'> <'\t\tgit diff -Oorder_file_$i --name-only HEAD HEAD^ HEAD^2 >actual &&\n'> <'\t\ttest_cmp expect_$i actual\n'> <'\t'> ) } ) ] ) ) (C {<test_done>}) ] )