(command.CommandList children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:test_description) op: Equal rhs: {(SQ <'commit and log output encodings'>)} ) ] ) (C {(.)} {(./test-lib.sh)}) (command.FuncDef name: compare_with body: (command.BraceGroup children: [ (command.AndOr ops: [Op_DAmp] children: [ (command.Pipeline children: [ (C {(git)} {(show)} {(-s)} {($ VSub_Number '$1')}) (command.SimpleCommand words: [{(sed)} {(-e)} {(SQ <'1,/^$/d'>)} {(-e)} {(SQ <'s/^ //'>)}] redirects: [(redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(current)})] ) ] negated: F ) (command.Case to_match: {(DQ ($ VSub_Number '$3'))} arms: [ (case_arm pat_list: [{(SQ )}] action: [(C {(test_cmp)} {(DQ ($ VSub_Number '$2'))} {(current)})] ) (case_arm pat_list: [{(Lit_Other '?') (Lit_Other '*')}] action: [ (command.AndOr ops: [Op_DAmp Op_DAmp] children: [ (command.SimpleCommand words: [{(iconv)} {(-f)} {(DQ ($ VSub_Number '$3'))} {(-t)} {(UTF-8)}] redirects: [ (redir.Redir op: <Redir_Great '>'> fd: 16777215 arg_word: {(current.utf8)} ) (redir.Redir op: <Redir_Less '<'> fd: 16777215 arg_word: {(current)} ) ] ) (command.SimpleCommand words: [{(iconv)} {(-f)} {(DQ ($ VSub_Number '$3'))} {(-t)} {(UTF-8)}] redirects: [ (redir.Redir op: <Redir_Great '>'> fd: 16777215 arg_word: {(expect.utf8)} ) (redir.Redir op: <Redir_Less '<'> fd: 16777215 arg_word: {(DQ ($ VSub_Number '$2'))} ) ] ) (C {(test_cmp)} {(expect.utf8)} {(current.utf8)}) ] ) ] ) ] ) ] ) ] ) ) (C {(test_expect_success)} {(setup)} { (SQ <'\n'> <'\t: >F &&\n'> <'\tgit add F &&\n'> <'\tT=$(git write-tree) &&\n'> <'\tC=$(git commit-tree $T <"$TEST_DIRECTORY"/t3900/1-UTF-8.txt) &&\n'> <'\tgit update-ref HEAD $C &&\n'> <'\tgit tag C0\n'> ) } ) (C {(test_expect_success)} {(SQ <'no encoding header for base case'>)} { (SQ <'\n'> <'\tE=$(git cat-file commit C0 | sed -ne "s/^encoding //p") &&\n'> <'\ttest z = "z$E"\n'> ) } ) (C {(test_expect_success)} {(SQ <'UTF-16 refused because of NULs'>)} { (SQ <'\n'> <'\techo UTF-16 >F &&\n'> <'\ttest_must_fail git commit -a -F "$TEST_DIRECTORY"/t3900/UTF-16.txt\n'> ) } ) (C {(test_expect_success)} {(SQ <'UTF-8 invalid characters refused'>)} { (SQ <'\n'> <'\ttest_when_finished "rm -f $HOME/stderr $HOME/invalid" &&\n'> <'\techo "UTF-8 characters" >F &&\n'> <'\tprintf "Commit message\\n\\nInvalid surrogate:\\355\\240\\200\\n" \\\n'> <'\t\t>"$HOME/invalid" &&\n'> <'\tgit commit -a -F "$HOME/invalid" 2>"$HOME"/stderr &&\n'> <'\ttest_i18ngrep "did not conform" "$HOME"/stderr\n'> ) } ) (C {(test_expect_success)} {(SQ <'UTF-8 overlong sequences rejected'>)} { (SQ <'\n'> <'\ttest_when_finished "rm -f $HOME/stderr $HOME/invalid" &&\n'> <'\trm -f "$HOME/stderr" "$HOME/invalid" &&\n'> <'\techo "UTF-8 overlong" >F &&\n'> <'\tprintf "\\340\\202\\251ommit message\\n\\nThis is not a space:\\300\\240\\n" \\\n'> <'\t\t>"$HOME/invalid" &&\n'> <'\tgit commit -a -F "$HOME/invalid" 2>"$HOME"/stderr &&\n'> <'\ttest_i18ngrep "did not conform" "$HOME"/stderr\n'> ) } ) (C {(test_expect_success)} {(SQ <'UTF-8 non-characters refused'>)} { (SQ <'\n'> <'\ttest_when_finished "rm -f $HOME/stderr $HOME/invalid" &&\n'> <'\techo "UTF-8 non-character 1" >F &&\n'> <'\tprintf "Commit message\\n\\nNon-character:\\364\\217\\277\\276\\n" \\\n'> <'\t\t>"$HOME/invalid" &&\n'> <'\tgit commit -a -F "$HOME/invalid" 2>"$HOME"/stderr &&\n'> <'\ttest_i18ngrep "did not conform" "$HOME"/stderr\n'> ) } ) (C {(test_expect_success)} {(SQ <'UTF-8 non-characters refused'>)} { (SQ <'\n'> <'\ttest_when_finished "rm -f $HOME/stderr $HOME/invalid" &&\n'> <'\techo "UTF-8 non-character 2." >F &&\n'> <'\tprintf "Commit message\\n\\nNon-character:\\357\\267\\220\\n" \\\n'> <'\t\t>"$HOME/invalid" &&\n'> <'\tgit commit -a -F "$HOME/invalid" 2>"$HOME"/stderr &&\n'> <'\ttest_i18ngrep "did not conform" "$HOME"/stderr\n'> ) } ) (command.ForEach iter_name: H iter_words: [{(ISO8859-1)} {(eucJP)} {(ISO-2022-JP)}] do_arg_iter: F body: (command.DoGroup children: [ (C {(test_expect_success)} {(DQ ($ VSub_DollarName '$H') (' setup'))} { (SQ <'\n'> <'\t\tgit config i18n.commitencoding $H &&\n'> <'\t\tgit checkout -b $H C0 &&\n'> <'\t\techo $H >F &&\n'> <'\t\tgit commit -a -F "$TEST_DIRECTORY"/t3900/$H.txt\n'> <'\t'> ) } ) ] ) ) (command.ForEach iter_name: H iter_words: [{(ISO8859-1)} {(eucJP)} {(ISO-2022-JP)}] do_arg_iter: F body: (command.DoGroup children: [ (C {(test_expect_success)} {(DQ ('check encoding header for ') ($ VSub_DollarName '$H'))} {(SQ <'\n'> <'\t\tE=$(git cat-file commit '>) ($ VSub_DollarName '$H') (SQ <' | sed -ne "s/^encoding //p") &&\n'> <'\t\ttest "z$E" = "z'>) ($ VSub_DollarName '$H') (SQ <'"\n'> <'\t'>) } ) ] ) ) (C {(test_expect_success)} {(SQ <'config to remove customization'>)} { (SQ <'\n'> <'\tgit config --unset-all i18n.commitencoding &&\n'> <'\tif Z=$(git config --get-all i18n.commitencoding)\n'> <'\tthen\n'> <'\t\techo Oops, should have failed.\n'> <'\t\tfalse\n'> <'\telse\n'> <'\t\ttest z = "z$Z"\n'> <'\tfi &&\n'> <'\tgit config i18n.commitencoding UTF-8\n'> ) } ) (C {(test_expect_success)} {(SQ <'ISO8859-1 should be shown in UTF-8 now'>)} {(SQ <'\n'> <'\tcompare_with ISO8859-1 "$TEST_DIRECTORY"/t3900/1-UTF-8.txt\n'>)} ) (command.ForEach iter_name: H iter_words: [{(eucJP)} {(ISO-2022-JP)}] do_arg_iter: F body: (command.DoGroup children: [ (C {(test_expect_success)} {(DQ ($ VSub_DollarName '$H') (' should be shown in UTF-8 now'))} {(SQ <'\n'> <'\t\tcompare_with '>) ($ VSub_DollarName '$H') (SQ <' "$TEST_DIRECTORY"/t3900/2-UTF-8.txt\n'> <'\t'>) } ) ] ) ) (C {(test_expect_success)} {(SQ <'config to add customization'>)} { (SQ <'\n'> <'\tgit config --unset-all i18n.commitencoding &&\n'> <'\tif Z=$(git config --get-all i18n.commitencoding)\n'> <'\tthen\n'> <'\t\techo Oops, should have failed.\n'> <'\t\tfalse\n'> <'\telse\n'> <'\t\ttest z = "z$Z"\n'> <'\tfi\n'> ) } ) (command.ForEach iter_name: H iter_words: [{(ISO8859-1)} {(eucJP)} {(ISO-2022-JP)}] do_arg_iter: F body: (command.DoGroup children: [ (C {(test_expect_success)} {(DQ ($ VSub_DollarName '$H') (' should be shown in itself now'))} {(SQ <'\n'> <'\t\tgit config i18n.commitencoding '>) ($ VSub_DollarName '$H') (SQ <' &&\n'> <'\t\tcompare_with '>) ($ VSub_DollarName '$H') (SQ <' "$TEST_DIRECTORY"/t3900/'>) ($ VSub_DollarName '$H') (SQ <'.txt\n'> <'\t'>) } ) ] ) ) (C {(test_expect_success)} {(SQ <'config to tweak customization'>)} {(SQ <'\n'> <'\tgit config i18n.logoutputencoding UTF-8\n'>)} ) (C {(test_expect_success)} {(SQ <'ISO8859-1 should be shown in UTF-8 now'>)} {(SQ <'\n'> <'\tcompare_with ISO8859-1 "$TEST_DIRECTORY"/t3900/1-UTF-8.txt\n'>)} ) (command.ForEach iter_name: H iter_words: [{(eucJP)} {(ISO-2022-JP)}] do_arg_iter: F body: (command.DoGroup children: [ (C {(test_expect_success)} {(DQ ($ VSub_DollarName '$H') (' should be shown in UTF-8 now'))} {(SQ <'\n'> <'\t\tcompare_with '>) ($ VSub_DollarName '$H') (SQ <' "$TEST_DIRECTORY"/t3900/2-UTF-8.txt\n'> <'\t'>) } ) ] ) ) (command.ForEach iter_name: J iter_words: [{(eucJP)} {(ISO-2022-JP)}] do_arg_iter: F body: (command.DoGroup children: [ (command.If arms: [ (if_arm cond: [(C {(test)} {(DQ ($ VSub_DollarName '$J'))} {(Lit_Other '=')} {(ISO-2022-JP)})] action: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:ICONV) op: Equal rhs: {($ VSub_DollarName '$J')} ) ] ) ] ) ] else_action: [ (command.Assignment keyword: Assign_None pairs: [(assign_pair lhs:(lhs_expr.LhsName name:ICONV) op:Equal rhs:(word.EmptyWord))] ) ] ) (C {(git)} {(config)} {(i18n.logoutputencoding)} {($ VSub_DollarName '$J')}) (command.ForEach iter_name: H iter_words: [{(eucJP)} {(ISO-2022-JP)}] do_arg_iter: F body: (command.DoGroup children: [ (C {(test_expect_success)} { (DQ ($ VSub_DollarName '$H') (' should be shown in ') ($ VSub_DollarName '$J') (' now') ) } {(SQ <'\n'> <'\t\t\tcompare_with '>) ($ VSub_DollarName '$H') (SQ <' "$TEST_DIRECTORY"/t3900/'>) ($ VSub_DollarName '$J') (SQ <'.txt $ICONV\n'> <'\t\t'>) } ) ] ) ) ] ) ) (command.ForEach iter_name: H iter_words: [{(ISO8859-1)} {(eucJP)} {(ISO-2022-JP)}] do_arg_iter: F body: (command.DoGroup children: [ (C {(test_expect_success)} {(DQ ('No conversion with ') ($ VSub_DollarName '$H'))} {(SQ <'\n'> <'\t\tcompare_with "--encoding=none '>) ($ VSub_DollarName '$H') (SQ <'" "$TEST_DIRECTORY"/t3900/'>) ($ VSub_DollarName '$H') (SQ <'.txt\n'> <'\t'>) } ) ] ) ) (command.FuncDef name: test_commit_autosquash_flags body: (command.BraceGroup children: [ (command.Assignment keyword: Assign_None pairs: [(assign_pair lhs:(lhs_expr.LhsName name:H) op:Equal rhs:{($ VSub_Number '$1')})] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:flag) op: Equal rhs: {($ VSub_Number '$2')} ) ] ) (C {(test_expect_success)} { (DQ ('commit --') ($ VSub_DollarName '$flag') (' with ') ($ VSub_DollarName '$H') (' encoding') ) } { (SQ <'\n'> <'\t\tgit config i18n.commitencoding $H &&\n'> <'\t\tgit checkout -b $H-$flag C0 &&\n'> <'\t\techo $H >>F &&\n'> <'\t\tgit commit -a -F "$TEST_DIRECTORY"/t3900/$H.txt &&\n'> <'\t\ttest_tick &&\n'> <'\t\techo intermediate stuff >>G &&\n'> <'\t\tgit add G &&\n'> <'\t\tgit commit -a -m "intermediate commit" &&\n'> <'\t\ttest_tick &&\n'> <'\t\techo $H $flag >>F &&\n'> <'\t\tgit commit -a --$flag HEAD~1 &&\n'> <'\t\tE=$(git cat-file commit '> ) ($ VSub_DollarName '$H') (-) ($ VSub_DollarName '$flag') (SQ <' |\n'> <'\t\t\tsed -ne "s/^encoding //p") &&\n'> <'\t\ttest "z$E" = "z$H" &&\n'> <'\t\tgit config --unset-all i18n.commitencoding &&\n'> <'\t\tgit rebase --autosquash -i HEAD^^^ &&\n'> <'\t\tgit log --oneline >actual &&\n'> <'\t\ttest_line_count = 3 actual\n'> <'\t'> ) } ) ] ) ) (C {(test_commit_autosquash_flags)} {(eucJP)} {(fixup)}) (C {(test_commit_autosquash_flags)} {(ISO-2022-JP)} {(squash)}) (C {(test_done)}) ] )