(command.CommandList children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:test_description) op: Equal rhs: {(SQ <'CRLF conversion all combinations'>)} ) ] ) (C {(.)} {(./test-lib.sh)}) (command.If arms: [ (if_arm cond: [(command.Pipeline children:[(C {(test_have_prereq)} {(EXPENSIVE)})] negated:T)] action: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:skip_all) op: Equal rhs: {(DQ ('EXPENSIVE not set'))} ) ] ) (C {(test_done)}) ] ) ] ) (command.FuncDef name: compare_files body: (command.BraceGroup children: [ (command.AndOr ops: [Op_DAmp Op_DAmp Op_DAmp] children: [ (command.SimpleCommand words: [{(tr)} {(SQ <'\\015\\000'>)} {(QN)}] redirects: [ (redir.Redir op: <Redir_Less '<'> fd: 16777215 arg_word: {(DQ ($ VSub_Number '$1'))} ) (redir.Redir op: <Redir_Great '>'> fd: 16777215 arg_word: {(DQ ($ VSub_Number '$1')) (.expect)} ) ] ) (command.Pipeline children: [ (command.SimpleCommand words: [{(tr)} {(SQ <'\\015\\000'>)} {(QN)}] redirects: [ (redir.Redir op: <Redir_Less '<'> fd: 16777215 arg_word: {(DQ ($ VSub_Number '$2'))} ) ] ) (command.SimpleCommand words: [{(tr)} {(-d)} {(SQ <Z>)}] redirects: [ (redir.Redir op: <Redir_Great '>'> fd: 16777215 arg_word: {(DQ ($ VSub_Number '$2')) (.actual)} ) ] ) ] negated: F ) (C {(test_cmp)} {(DQ ($ VSub_Number '$1')) (.expect)} {(DQ ($ VSub_Number '$2')) (.actual)} ) (C {(rm)} {(DQ ($ VSub_Number '$1')) (.expect)} {(DQ ($ VSub_Number '$2')) (.actual)}) ] ) ] ) ) (command.FuncDef name: compare_ws_file body: (command.BraceGroup children: [ (command.Assignment keyword: Assign_None pairs: [(assign_pair lhs:(lhs_expr.LhsName name:pfx) op:Equal rhs:{($ VSub_Number '$1')})] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:exp) op: Equal rhs: {($ VSub_Number '$2') (.expect)} ) ] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:act) op: Equal rhs: {($ VSub_DollarName '$pfx') (.actual.) ($ VSub_Number '$3')} ) ] ) (command.AndOr ops: [Op_DAmp Op_DAmp Op_DAmp] children: [ (command.SimpleCommand words: [{(tr)} {(SQ <'\\015\\000abcdef0123456789'>)} {(QN00000000000000000)}] redirects: [ (redir.Redir op: <Redir_Less '<'> fd: 16777215 arg_word: {(DQ ($ VSub_Number '$2'))} ) (redir.Redir op: <Redir_Great '>'> fd: 16777215 arg_word: {(DQ ($ VSub_DollarName '$exp'))} ) ] ) (command.SimpleCommand words: [{(tr)} {(SQ <'\\015\\000abcdef0123456789'>)} {(QN00000000000000000)}] redirects: [ (redir.Redir op: <Redir_Less '<'> fd: 16777215 arg_word: {(DQ ($ VSub_Number '$3'))} ) (redir.Redir op: <Redir_Great '>'> fd: 16777215 arg_word: {(DQ ($ VSub_DollarName '$act'))} ) ] ) (C {(test_cmp)} {(DQ ($ VSub_DollarName '$exp'))} {(DQ ($ VSub_DollarName '$act'))}) (C {(rm)} {(DQ ($ VSub_DollarName '$exp'))} {(DQ ($ VSub_DollarName '$act'))}) ] ) ] ) ) (command.FuncDef name: create_gitattributes body: (command.BraceGroup children: [ (command.BraceGroup children: [ (command.WhileUntil keyword: <KW_While while> cond: [(C {(test)} {(DQ ($ VSub_Pound '$#'))} {(KW_Bang '!') (Lit_Other '=')} {(0)})] body: (command.DoGroup children: [ (command.AndOr ops: [Op_DAmp] children: [ (command.Case to_match: {(DQ ($ VSub_Number '$1'))} arms: [ (case_arm pat_list: [{(auto)}] action: [(C {(echo)} {(SQ <'*.txt text=auto'>)})] ) (case_arm pat_list: [{(ident)}] action: [(C {(echo)} {(SQ <'*.txt ident'>)})] ) (case_arm pat_list: [{(text)}] action: [(C {(echo)} {(SQ <'*.txt text'>)})] ) (case_arm pat_list: [{(-text)}] action: [(C {(echo)} {(SQ <'*.txt -text'>)})] ) (case_arm pat_list: [{(crlf)}] action: [(C {(echo)} {(SQ <'*.txt eol=crlf'>)})] ) (case_arm pat_list: [{(lf)}] action: [(C {(echo)} {(SQ <'*.txt eol=lf'>)})] ) (case_arm pat_list:[{(DQ )}]) (case_arm pat_list: [{(Lit_Other '*')}] action: [ (command.SimpleCommand words: [ {(echo)} {(invalid)} {(attribute) (Lit_Other ':')} {(DQ ($ VSub_Number '$1'))} ] redirects: [ (redir.Redir op: <Redir_GreatAnd '>&'> fd: 16777215 arg_word: {(2)} ) ] ) (command.ControlFlow token: <ControlFlow_Exit exit> arg_word: {(1)} ) ] ) ] ) (C {(shift)}) ] ) ] ) ) ] redirects: [(redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(.gitattributes)})] ) ] ) ) (command.FuncDef name: create_NNO_files body: (command.BraceGroup children: [ (command.ForEach iter_name: crlf iter_words: [{(false)} {(true)} {(input)}] do_arg_iter: F body: (command.DoGroup children: [ (command.ForEach iter_name: attr iter_words: [{(DQ )} {(auto)} {(text)} {(-text)}] do_arg_iter: F body: (command.DoGroup children: [ (command.ForEach iter_name: aeol iter_words: [{(DQ )} {(lf)} {(crlf)}] do_arg_iter: F body: (command.DoGroup children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:pfx) op: Equal rhs: {(NNO_attr_) (${ VSub_Name attr) (_aeol_) (${ VSub_Name aeol) (_) (${ VSub_Name crlf) } ) ] ) (command.AndOr ops: [Op_DAmp Op_DAmp Op_DAmp Op_DAmp] children: [ (C {(cp)} {(CRLF_mix_LF)} {(${ VSub_Name pfx) (_LF.txt)}) (C {(cp)} {(CRLF_mix_LF)} {(${ VSub_Name pfx) (_CRLF.txt)}) (C {(cp)} {(CRLF_mix_LF)} {(${ VSub_Name pfx) (_CRLF_mix_LF.txt)} ) (C {(cp)} {(CRLF_mix_LF)} {(${ VSub_Name pfx) (_LF_mix_CR.txt)}) (C {(cp)} {(CRLF_mix_LF)} {(${ VSub_Name pfx) (_CRLF_nul.txt)}) ] ) ] ) ) ] ) ) ] ) ) ] ) ) (command.FuncDef name: check_warning body: (command.BraceGroup children: [ (command.Case to_match: {(DQ ($ VSub_Number '$1'))} arms: [ (case_arm pat_list: [{(LF_CRLF)}] action: [ (command.SimpleCommand words: [{(echo)} {(DQ ('warning: LF will be replaced by CRLF'))}] redirects: [ (redir.Redir op: <Redir_Great '>'> fd: 16777215 arg_word: {(DQ ($ VSub_Number '$2')) (.expect)} ) ] ) ] ) (case_arm pat_list: [{(CRLF_LF)}] action: [ (command.SimpleCommand words: [{(echo)} {(DQ ('warning: CRLF will be replaced by LF'))}] redirects: [ (redir.Redir op: <Redir_Great '>'> fd: 16777215 arg_word: {(DQ ($ VSub_Number '$2')) (.expect)} ) ] ) ] ) (case_arm pat_list: [{(SQ )}] action: [ (command.SimpleCommand redirects: [ (redir.Redir op: <Redir_Great '>'> fd: 16777215 arg_word: {(DQ ($ VSub_Number '$2')) (.expect)} ) ] ) ] ) (case_arm pat_list: [{(Lit_Other '*')}] action: [ (command.Sentence child: (command.SimpleCommand words: [ {(echo)} {(DQ ('Illegal 1')) (Lit_Other ':')} {(DQ ($ VSub_Number '$1'))} ] redirects: [(redir.Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(2)})] ) terminator: <Op_Semi ';'> ) (command.ControlFlow token: <ControlFlow_Return return> arg_word: {(false)} ) ] ) ] ) (command.Pipeline children: [ (C {(grep)} {(DQ ('will be replaced by'))} {(DQ ($ VSub_Number '$2'))}) (C {(sed)} {(-e)} { (DQ (s/) (Lit_Other '\\') ('(.*') (Lit_Other '\\') (') in [^ ]*') (Lit_Other '$') (/) (Lit_Other '\\') (1/) ) } ) (command.SimpleCommand words: [{(uniq)}] redirects: [ (redir.Redir op: <Redir_Great '>'> fd: 16777215 arg_word: {(DQ ($ VSub_Number '$2')) (.actual)} ) ] ) ] negated: F ) (C {(test_cmp)} {(DQ ($ VSub_Number '$2')) (.expect)} {(DQ ($ VSub_Number '$2')) (.actual)}) ] ) ) (command.FuncDef name: commit_check_warn body: (command.BraceGroup children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:crlf) op: Equal rhs: {($ VSub_Number '$1')} ) ] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:attr) op: Equal rhs: {($ VSub_Number '$2')} ) ] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:lfname) op: Equal rhs: {($ VSub_Number '$3')} ) ] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:crlfname) op: Equal rhs: {($ VSub_Number '$4')} ) ] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:lfmixcrlf) op: Equal rhs: {($ VSub_Number '$5')} ) ] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:lfmixcr) op: Equal rhs: {($ VSub_Number '$6')} ) ] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:crlfnul) op: Equal rhs: {($ VSub_Number '$7')} ) ] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:pfx) op: Equal rhs: {(crlf_) (${ VSub_Name crlf) (_attr_) (${ VSub_Name attr)} ) ] ) (command.AndOr ops: [Op_DAmp Op_DAmp Op_DAmp Op_DAmp Op_DAmp Op_DAmp Op_DAmp] children: [ (C {(create_gitattributes)} {(DQ ($ VSub_DollarName '$attr'))}) (command.ForEach iter_name: f iter_words: [{(LF)} {(CRLF)} {(LF_mix_CR)} {(CRLF_mix_LF)} {(LF_nul)} {(CRLF_nul)}] do_arg_iter: F body: (command.DoGroup children: [ (command.AndOr ops: [Op_DAmp Op_DAmp] children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:fname) op: Equal rhs: {(${ VSub_Name pfx) (_) ($ VSub_DollarName '$f') (.txt)} ) ] ) (C {(cp)} {($ VSub_DollarName '$f')} {($ VSub_DollarName '$fname')}) (command.SimpleCommand words: [ {(git)} {(-c)} {(core.autocrlf) (Lit_Other '=') ($ VSub_DollarName '$crlf')} {(add)} {($ VSub_DollarName '$fname')} ] redirects: [ (redir.Redir op: <Redir_Great '2>'> fd: 2 arg_word: {(DQ (${ VSub_Name pfx) (_) ($ VSub_DollarName '$f') (.err))} ) ] ) ] ) ] ) ) (C {(git)} {(commit)} {(-m)} {(DQ ('core.autocrlf ') ($ VSub_DollarName '$crlf'))}) (C {(check_warning)} {(DQ ($ VSub_DollarName '$lfname'))} {(${ VSub_Name pfx) (_LF.err)}) (C {(check_warning)} {(DQ ($ VSub_DollarName '$crlfname'))} {(${ VSub_Name pfx) (_CRLF.err)} ) (C {(check_warning)} {(DQ ($ VSub_DollarName '$lfmixcrlf'))} {(${ VSub_Name pfx) (_CRLF_mix_LF.err)} ) (C {(check_warning)} {(DQ ($ VSub_DollarName '$lfmixcr'))} {(${ VSub_Name pfx) (_LF_mix_CR.err)} ) (C {(check_warning)} {(DQ ($ VSub_DollarName '$crlfnul'))} {(${ VSub_Name pfx) (_CRLF_nul.err)} ) ] ) ] ) ) (command.FuncDef name: commit_chk_wrnNNO body: (command.BraceGroup children: [ (command.Sentence child: (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:attr) op: Equal rhs: {($ VSub_Number '$1')} ) ] ) terminator: <Op_Semi ';'> ) (C {(shift)}) (command.Sentence child: (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:aeol) op: Equal rhs: {($ VSub_Number '$1')} ) ] ) terminator: <Op_Semi ';'> ) (C {(shift)}) (command.Sentence child: (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:crlf) op: Equal rhs: {($ VSub_Number '$1')} ) ] ) terminator: <Op_Semi ';'> ) (C {(shift)}) (command.Sentence child: (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:lfwarn) op: Equal rhs: {($ VSub_Number '$1')} ) ] ) terminator: <Op_Semi ';'> ) (C {(shift)}) (command.Sentence child: (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:crlfwarn) op: Equal rhs: {($ VSub_Number '$1')} ) ] ) terminator: <Op_Semi ';'> ) (C {(shift)}) (command.Sentence child: (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:lfmixcrlf) op: Equal rhs: {($ VSub_Number '$1')} ) ] ) terminator: <Op_Semi ';'> ) (C {(shift)}) (command.Sentence child: (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:lfmixcr) op: Equal rhs: {($ VSub_Number '$1')} ) ] ) terminator: <Op_Semi ';'> ) (C {(shift)}) (command.Sentence child: (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:crlfnul) op: Equal rhs: {($ VSub_Number '$1')} ) ] ) terminator: <Op_Semi ';'> ) (C {(shift)}) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:pfx) op: Equal rhs: {(NNO_attr_) (${ VSub_Name attr) (_aeol_) (${ VSub_Name aeol) (_) (${ VSub_Name crlf)} ) ] ) (command.AndOr ops: [Op_DAmp] children: [ (C {(create_gitattributes)} {(DQ ($ VSub_DollarName '$attr'))} {($ VSub_DollarName '$aeol')} ) (command.ForEach iter_name: f iter_words: [{(LF)} {(CRLF)} {(CRLF_mix_LF)} {(LF_mix_CR)} {(CRLF_nul)}] do_arg_iter: F body: (command.DoGroup children: [ (command.AndOr ops: [Op_DAmp Op_DAmp Op_DAmp] children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:fname) op: Equal rhs: {(${ VSub_Name pfx) (_) ($ VSub_DollarName '$f') (.txt)} ) ] ) (C {(cp)} {($ VSub_DollarName '$f')} {($ VSub_DollarName '$fname')}) (command.SimpleCommand words: [{(printf)} {(Z)}] redirects: [ (redir.Redir op: <Redir_DGreat '>>'> fd: 16777215 arg_word: {(DQ ($ VSub_DollarName '$fname'))} ) ] ) (command.SimpleCommand words: [ {(git)} {(-c)} {(core.autocrlf) (Lit_Other '=') ($ VSub_DollarName '$crlf')} {(add)} {($ VSub_DollarName '$fname')} ] redirects: [ (redir.Redir op: <Redir_Great '2>'> fd: 2 arg_word: {(DQ (${ VSub_Name pfx) (_) ($ VSub_DollarName '$f') (.err))} ) ] ) ] ) ] ) ) ] ) (C {(test_expect_success)} { (DQ ('commit NNO files crlf=') ($ VSub_DollarName '$crlf') (' attr=') ($ VSub_DollarName '$attr') (' LF') ) } {(SQ <'\n'> <'\t\tcheck_warning "$lfwarn" ${pfx}_LF.err\n'> <'\t'>)} ) (C {(test_expect_success)} { (DQ ('commit NNO files attr=') ($ VSub_DollarName '$attr') (' aeol=') ($ VSub_DollarName '$aeol') (' crlf=') ($ VSub_DollarName '$crlf') (' CRLF') ) } {(SQ <'\n'> <'\t\tcheck_warning "$crlfwarn" ${pfx}_CRLF.err\n'> <'\t'>)} ) (C {(test_expect_success)} { (DQ ('commit NNO files attr=') ($ VSub_DollarName '$attr') (' aeol=') ($ VSub_DollarName '$aeol') (' crlf=') ($ VSub_DollarName '$crlf') (' CRLF_mix_LF') ) } {(SQ <'\n'> <'\t\tcheck_warning "$lfmixcrlf" ${pfx}_CRLF_mix_LF.err\n'> <'\t'>)} ) (C {(test_expect_success)} { (DQ ('commit NNO files attr=') ($ VSub_DollarName '$attr') (' aeol=') ($ VSub_DollarName '$aeol') (' crlf=') ($ VSub_DollarName '$crlf') (' LF_mix_cr') ) } {(SQ <'\n'> <'\t\tcheck_warning "$lfmixcr" ${pfx}_LF_mix_CR.err\n'> <'\t'>)} ) (C {(test_expect_success)} { (DQ ('commit NNO files attr=') ($ VSub_DollarName '$attr') (' aeol=') ($ VSub_DollarName '$aeol') (' crlf=') ($ VSub_DollarName '$crlf') (' CRLF_nul') ) } {(SQ <'\n'> <'\t\tcheck_warning "$crlfnul" ${pfx}_CRLF_nul.err\n'> <'\t'>)} ) ] ) ) (command.FuncDef name: stats_ascii body: (command.BraceGroup children: [ (command.Case to_match: {(DQ ($ VSub_Number '$1'))} arms: [ (case_arm pat_list:[{(LF)}] action:[(C {(echo)} {(lf)})]) (case_arm pat_list:[{(CRLF)}] action:[(C {(echo)} {(crlf)})]) (case_arm pat_list:[{(CRLF_mix_LF)}] action:[(C {(echo)} {(mixed)})]) (case_arm pat_list: [{(LF_mix_CR)} {(CRLF_nul)} {(LF_nul)} {(CRLF_mix_CR)}] action: [(C {(echo)} {(DQ (-text))})] ) (case_arm pat_list: [{(Lit_Other '*')}] action: [(C {(echo)} {(error_invalid)} {($ VSub_Number '$1')})] ) ] ) ] ) ) (command.FuncDef name: attr_ascii body: (command.BraceGroup children: [ (command.Case to_match: {($ VSub_Number '$1') (Lit_Comma ',') ($ VSub_Number '$2')} arms: [ (case_arm pat_list: [{(-text) (Lit_Comma ',') (Lit_Other '*')}] action: [(C {(echo)} {(DQ (-text))})] ) (case_arm pat_list: [{(text) (Lit_Comma ',')}] action: [(C {(echo)} {(DQ (text))})] ) (case_arm pat_list: [{(text) (Lit_Comma ',') (lf)}] action: [(C {(echo)} {(DQ ('text eol=lf'))})] ) (case_arm pat_list: [{(text) (Lit_Comma ',') (crlf)}] action: [(C {(echo)} {(DQ ('text eol=crlf'))})] ) (case_arm pat_list: [{(auto) (Lit_Comma ',')}] action: [(C {(echo)} {(DQ ('text=auto'))})] ) (case_arm pat_list: [{(auto) (Lit_Comma ',') (lf)}] action: [(C {(echo)} {(DQ ('text=auto eol=lf'))})] ) (case_arm pat_list: [{(auto) (Lit_Comma ',') (crlf)}] action: [(C {(echo)} {(DQ ('text=auto eol=crlf'))})] ) (case_arm pat_list: [{(lf) (Lit_Comma ',')}] action: [(C {(echo)} {(DQ ('text eol=lf'))})] ) (case_arm pat_list: [{(crlf) (Lit_Comma ',')}] action: [(C {(echo)} {(DQ ('text eol=crlf'))})] ) (case_arm pat_list:[{(Lit_Comma ',')}] action:[(C {(echo)} {(DQ )})]) (case_arm pat_list: [{(Lit_Other '*')}] action: [ (C {(echo)} {(invalid_attr)} {(DQ ($ VSub_Number '$1') (',') ($ VSub_Number '$2'))}) ] ) ] ) ] ) ) (command.FuncDef name: check_files_in_repo body: (command.BraceGroup children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:crlf) op: Equal rhs: {($ VSub_Number '$1')} ) ] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:attr) op: Equal rhs: {($ VSub_Number '$2')} ) ] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:lfname) op: Equal rhs: {($ VSub_Number '$3')} ) ] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:crlfname) op: Equal rhs: {($ VSub_Number '$4')} ) ] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:lfmixcrlf) op: Equal rhs: {($ VSub_Number '$5')} ) ] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:lfmixcr) op: Equal rhs: {($ VSub_Number '$6')} ) ] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:crlfnul) op: Equal rhs: {($ VSub_Number '$7')} ) ] ) (command.AndOr ops: [Op_DAmp Op_DAmp Op_DAmp Op_DAmp Op_DAmp] children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:pfx) op: Equal rhs: {(crlf_) (${ VSub_Name crlf) (_attr_) (${ VSub_Name attr) (_)} ) ] ) (C {(compare_files)} {($ VSub_DollarName '$lfname')} {(${ VSub_Name pfx) (LF.txt)}) (C {(compare_files)} {($ VSub_DollarName '$crlfname')} {(${ VSub_Name pfx) (CRLF.txt)}) (C {(compare_files)} {($ VSub_DollarName '$lfmixcrlf')} {(${ VSub_Name pfx) (CRLF_mix_LF.txt)} ) (C {(compare_files)} {($ VSub_DollarName '$lfmixcr')} {(${ VSub_Name pfx) (LF_mix_CR.txt)} ) (C {(compare_files)} {($ VSub_DollarName '$crlfnul')} {(${ VSub_Name pfx) (CRLF_nul.txt)} ) ] ) ] ) ) (command.FuncDef name: check_in_repo_NNO body: (command.BraceGroup children: [ (command.Sentence child: (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:attr) op: Equal rhs: {($ VSub_Number '$1')} ) ] ) terminator: <Op_Semi ';'> ) (C {(shift)}) (command.Sentence child: (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:aeol) op: Equal rhs: {($ VSub_Number '$1')} ) ] ) terminator: <Op_Semi ';'> ) (C {(shift)}) (command.Sentence child: (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:crlf) op: Equal rhs: {($ VSub_Number '$1')} ) ] ) terminator: <Op_Semi ';'> ) (C {(shift)}) (command.Sentence child: (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:lfname) op: Equal rhs: {($ VSub_Number '$1')} ) ] ) terminator: <Op_Semi ';'> ) (C {(shift)}) (command.Sentence child: (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:crlfname) op: Equal rhs: {($ VSub_Number '$1')} ) ] ) terminator: <Op_Semi ';'> ) (C {(shift)}) (command.Sentence child: (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:lfmixcrlf) op: Equal rhs: {($ VSub_Number '$1')} ) ] ) terminator: <Op_Semi ';'> ) (C {(shift)}) (command.Sentence child: (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:lfmixcr) op: Equal rhs: {($ VSub_Number '$1')} ) ] ) terminator: <Op_Semi ';'> ) (C {(shift)}) (command.Sentence child: (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:crlfnul) op: Equal rhs: {($ VSub_Number '$1')} ) ] ) terminator: <Op_Semi ';'> ) (C {(shift)}) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:pfx) op: Equal rhs: {(NNO_attr_) (${ VSub_Name attr) (_aeol_) (${ VSub_Name aeol) (_) (${ VSub_Name crlf)} ) ] ) (C {(test_expect_success)} { (DQ ('compare_files ') ($ VSub_DollarName '$lfname') (' ') (${ VSub_Name pfx) (_LF.txt)) } {(SQ <'\n'> <'\t\tcompare_files $lfname ${pfx}_LF.txt\n'> <'\t'>)} ) (C {(test_expect_success)} { (DQ ('compare_files ') ($ VSub_DollarName '$crlfname') (' ') (${ VSub_Name pfx) (_CRLF.txt) ) } {(SQ <'\n'> <'\t\tcompare_files $crlfname ${pfx}_CRLF.txt\n'> <'\t'>)} ) (C {(test_expect_success)} { (DQ ('compare_files ') ($ VSub_DollarName '$lfmixcrlf') (' ') (${ VSub_Name pfx) (_CRLF_mix_LF.txt) ) } {(SQ <'\n'> <'\t\tcompare_files $lfmixcrlf ${pfx}_CRLF_mix_LF.txt\n'> <'\t'>)} ) (C {(test_expect_success)} { (DQ ('compare_files ') ($ VSub_DollarName '$lfmixcr') (' ') (${ VSub_Name pfx) (_LF_mix_CR.txt) ) } {(SQ <'\n'> <'\t\tcompare_files $lfmixcr ${pfx}_LF_mix_CR.txt\n'> <'\t'>)} ) (C {(test_expect_success)} { (DQ ('compare_files ') ($ VSub_DollarName '$crlfnul') (' ') (${ VSub_Name pfx) (_CRLF_nul.txt) ) } {(SQ <'\n'> <'\t\tcompare_files $crlfnul ${pfx}_CRLF_nul.txt\n'> <'\t'>)} ) ] ) ) (command.FuncDef name: checkout_files body: (command.BraceGroup children: [ (command.Sentence child: (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:attr) op: Equal rhs: {($ VSub_Number '$1')} ) ] ) terminator: <Op_Semi ';'> ) (C {(shift)}) (command.Sentence child: (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:ident) op: Equal rhs: {($ VSub_Number '$1')} ) ] ) terminator: <Op_Semi ';'> ) (C {(shift)}) (command.Sentence child: (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:aeol) op: Equal rhs: {($ VSub_Number '$1')} ) ] ) terminator: <Op_Semi ';'> ) (C {(shift)}) (command.Sentence child: (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:crlf) op: Equal rhs: {($ VSub_Number '$1')} ) ] ) terminator: <Op_Semi ';'> ) (C {(shift)}) (command.Sentence child: (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:ceol) op: Equal rhs: {($ VSub_Number '$1')} ) ] ) terminator: <Op_Semi ';'> ) (C {(shift)}) (command.Sentence child: (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:lfname) op: Equal rhs: {($ VSub_Number '$1')} ) ] ) terminator: <Op_Semi ';'> ) (C {(shift)}) (command.Sentence child: (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:crlfname) op: Equal rhs: {($ VSub_Number '$1')} ) ] ) terminator: <Op_Semi ';'> ) (C {(shift)}) (command.Sentence child: (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:lfmixcrlf) op: Equal rhs: {($ VSub_Number '$1')} ) ] ) terminator: <Op_Semi ';'> ) (C {(shift)}) (command.Sentence child: (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:lfmixcr) op: Equal rhs: {($ VSub_Number '$1')} ) ] ) terminator: <Op_Semi ';'> ) (C {(shift)}) (command.Sentence child: (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:crlfnul) op: Equal rhs: {($ VSub_Number '$1')} ) ] ) terminator: <Op_Semi ';'> ) (C {(shift)}) (command.AndOr ops: [Op_DAmp Op_DAmp Op_DAmp] children: [ (C {(create_gitattributes)} {(DQ ($ VSub_DollarName '$attr'))} {($ VSub_DollarName '$ident')} {($ VSub_DollarName '$aeol')} ) (C {(git)} {(config)} {(core.autocrlf)} {($ VSub_DollarName '$crlf')}) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:pfx) op: Equal rhs: {(eol_) (${ VSub_Name ceol) (_crlf_) (${ VSub_Name crlf) (_attr_) (${ VSub_Name attr) (_) } ) ] ) (command.ForEach iter_name: f iter_words: [{(LF)} {(CRLF)} {(LF_mix_CR)} {(CRLF_mix_LF)} {(LF_nul)}] do_arg_iter: F body: (command.DoGroup children: [ (command.AndOr ops: [Op_DAmp] children: [ (C {(rm)} {(crlf_false_attr__) ($ VSub_DollarName '$f') (.txt)}) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(test)} {(-z)} {(DQ ($ VSub_DollarName '$ceol'))}) terminator: <Op_Semi ';'> ) ] action: [ (C {(git)} {(checkout)} {(crlf_false_attr__) ($ VSub_DollarName '$f') (.txt)} ) ] ) ] else_action: [ (C {(git)} {(-c)} {(core.eol) (Lit_Other '=') ($ VSub_DollarName '$ceol')} {(checkout)} {(crlf_false_attr__) ($ VSub_DollarName '$f') (.txt)} ) ] ) ] ) ] ) ) ] ) (C {(test_expect_success)} { (DQ ('ls-files --eol attr=') ($ VSub_DollarName '$attr') (' ') ($ VSub_DollarName '$ident') (' aeol=') ($ VSub_DollarName '$aeol') (' core.autocrlf=') ($ VSub_DollarName '$crlf') (' core.eol=') ($ VSub_DollarName '$ceol') ) } { (SQ <'\n'> <'\t\ttest_when_finished "rm expect actual" &&\n'> <'\t\tsort <<-EOF >expect &&\n'> <'\t\ti/crlf w/$(stats_ascii $crlfname) attr/$(attr_ascii $attr $aeol) crlf_false_attr__CRLF.txt\n'> < '\t\ti/mixed w/$(stats_ascii $lfmixcrlf) attr/$(attr_ascii $attr $aeol) crlf_false_attr__CRLF_mix_LF.txt\n' > <'\t\ti/lf w/$(stats_ascii $lfname) attr/$(attr_ascii $attr $aeol) crlf_false_attr__LF.txt\n'> < '\t\ti/-text w/$(stats_ascii $lfmixcr) attr/$(attr_ascii $attr $aeol) crlf_false_attr__LF_mix_CR.txt\n' > < '\t\ti/-text w/$(stats_ascii $crlfnul) attr/$(attr_ascii $attr $aeol) crlf_false_attr__CRLF_nul.txt\n' > < '\t\ti/-text w/$(stats_ascii $crlfnul) attr/$(attr_ascii $attr $aeol) crlf_false_attr__LF_nul.txt\n' > <'\t\tEOF\n'> <'\t\tgit ls-files --eol crlf_false_attr__* |\n'> <'\t\tsed -e "s/\t/ /g" -e "s/ */ /g" |\n'> <'\t\tsort >actual &&\n'> <'\t\ttest_cmp expect actual\n'> <'\t'> ) } ) (C {(test_expect_success)} { (DQ ('checkout attr=') ($ VSub_DollarName '$attr') (' ') ($ VSub_DollarName '$ident') (' aeol=') ($ VSub_DollarName '$aeol') (' core.autocrlf=') ($ VSub_DollarName '$crlf') (' core.eol=') ($ VSub_DollarName '$ceol') (' file=LF') ) } { (DQ ('\n') ('\t\tcompare_ws_file ') ($ VSub_DollarName '$pfx') (' ') ($ VSub_DollarName '$lfname') (' crlf_false_attr__LF.txt\n') ('\t') ) } ) (C {(test_expect_success)} { (DQ ('checkout attr=') ($ VSub_DollarName '$attr') (' ') ($ VSub_DollarName '$ident') (' aeol=') ($ VSub_DollarName '$aeol') (' core.autocrlf=') ($ VSub_DollarName '$crlf') (' core.eol=') ($ VSub_DollarName '$ceol') (' file=CRLF') ) } { (DQ ('\n') ('\t\tcompare_ws_file ') ($ VSub_DollarName '$pfx') (' ') ($ VSub_DollarName '$crlfname') (' crlf_false_attr__CRLF.txt\n') ('\t') ) } ) (C {(test_expect_success)} { (DQ ('checkout attr=') ($ VSub_DollarName '$attr') (' ') ($ VSub_DollarName '$ident') (' aeol=') ($ VSub_DollarName '$aeol') (' core.autocrlf=') ($ VSub_DollarName '$crlf') (' core.eol=') ($ VSub_DollarName '$ceol') (' file=CRLF_mix_LF') ) } { (DQ ('\n') ('\t\tcompare_ws_file ') ($ VSub_DollarName '$pfx') (' ') ($ VSub_DollarName '$lfmixcrlf') (' crlf_false_attr__CRLF_mix_LF.txt\n') ('\t') ) } ) (C {(test_expect_success)} { (DQ ('checkout attr=') ($ VSub_DollarName '$attr') (' ') ($ VSub_DollarName '$ident') (' aeol=') ($ VSub_DollarName '$aeol') (' core.autocrlf=') ($ VSub_DollarName '$crlf') (' core.eol=') ($ VSub_DollarName '$ceol') (' file=LF_mix_CR') ) } { (DQ ('\n') ('\t\tcompare_ws_file ') ($ VSub_DollarName '$pfx') (' ') ($ VSub_DollarName '$lfmixcr') (' crlf_false_attr__LF_mix_CR.txt\n') ('\t') ) } ) (C {(test_expect_success)} { (DQ ('checkout attr=') ($ VSub_DollarName '$attr') (' ') ($ VSub_DollarName '$ident') (' aeol=') ($ VSub_DollarName '$aeol') (' core.autocrlf=') ($ VSub_DollarName '$crlf') (' core.eol=') ($ VSub_DollarName '$ceol') (' file=LF_nul') ) } { (DQ ('\n') ('\t\tcompare_ws_file ') ($ VSub_DollarName '$pfx') (' ') ($ VSub_DollarName '$crlfnul') (' crlf_false_attr__LF_nul.txt\n') ('\t') ) } ) ] ) ) (C {(test_expect_success)} {(SQ <'ls-files --eol -o Text/Binary'>)} { (SQ <'\n'> <'\ttest_when_finished "rm expect actual TeBi_*" &&\n'> <'\tSTRT=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA &&\n'> <'\tSTR=$STRT$STRT$STRT$STRT &&\n'> <'\tprintf "${STR}BBB\\001" >TeBi_127_S &&\n'> <'\tprintf "${STR}BBBB\\001">TeBi_128_S &&\n'> <'\tprintf "${STR}BBB\\032" >TeBi_127_E &&\n'> <'\tprintf "\\032${STR}BBB" >TeBi_E_127 &&\n'> <'\tprintf "${STR}BBBB\\000">TeBi_128_N &&\n'> <'\tprintf "${STR}BBB\\012">TeBi_128_L &&\n'> <'\tprintf "${STR}BBB\\015">TeBi_127_C &&\n'> <'\tprintf "${STR}BB\\015\\012" >TeBi_126_CL &&\n'> <'\tprintf "${STR}BB\\015\\012\\015" >TeBi_126_CLC &&\n'> <'\tsort <<-\\EOF >expect &&\n'> <'\ti/ w/-text TeBi_127_S\n'> <'\ti/ w/none TeBi_128_S\n'> <'\ti/ w/none TeBi_127_E\n'> <'\ti/ w/-text TeBi_E_127\n'> <'\ti/ w/-text TeBi_128_N\n'> <'\ti/ w/lf TeBi_128_L\n'> <'\ti/ w/-text TeBi_127_C\n'> <'\ti/ w/crlf TeBi_126_CL\n'> <'\ti/ w/-text TeBi_126_CLC\n'> <'\tEOF\n'> <'\tgit ls-files --eol -o |\n'> <'\tsed -n -e "/TeBi_/{s!attr/[\t]*!!g\n'> <'\ts!\t! !g\n'> <'\ts! *! !g\n'> <'\tp\n'> <'\t}" | sort >actual &&\n'> <'\ttest_cmp expect actual\n'> ) } ) (C {(test_expect_success)} {(SQ <'setup master'>)} { (SQ <'\n'> <'\techo >.gitattributes &&\n'> <'\tgit checkout -b master &&\n'> <'\tgit add .gitattributes &&\n'> <'\tgit commit -m "add .gitattributes" "" &&\n'> < '\tprintf "\\$Id: 0000000000000000000000000000000000000000 \\$\\nLINEONE\\nLINETWO\\nLINETHREE" >LF &&\n' > < '\tprintf "\\$Id: 0000000000000000000000000000000000000000 \\$\\r\\nLINEONE\\r\\nLINETWO\\r\\nLINETHREE" >CRLF &&\n' > < '\tprintf "\\$Id: 0000000000000000000000000000000000000000 \\$\\nLINEONE\\r\\nLINETWO\\nLINETHREE" >CRLF_mix_LF &&\n' > < '\tprintf "\\$Id: 0000000000000000000000000000000000000000 \\$\\nLINEONE\\nLINETWO\\rLINETHREE" >LF_mix_CR &&\n' > < '\tprintf "\\$Id: 0000000000000000000000000000000000000000 \\$\\r\\nLINEONE\\r\\nLINETWO\\rLINETHREE" >CRLF_mix_CR &&\n' > < '\tprintf "\\$Id: 0000000000000000000000000000000000000000 \\$\\r\\nLINEONEQ\\r\\nLINETWO\\r\\nLINETHREE" | q_to_nul >CRLF_nul &&\n' > < '\tprintf "\\$Id: 0000000000000000000000000000000000000000 \\$\\nLINEONEQ\\nLINETWO\\nLINETHREE" | q_to_nul >LF_nul &&\n' > <'\tcreate_NNO_files CRLF_mix_LF CRLF_mix_LF CRLF_mix_LF CRLF_mix_LF CRLF_mix_LF &&\n'> <'\tgit -c core.autocrlf=false add NNO_*.txt &&\n'> <'\tgit commit -m "mixed line endings" &&\n'> <'\ttest_tick\n'> ) } ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:warn_LF_CRLF) op: Equal rhs: {(DQ ('LF will be replaced by CRLF'))} ) ] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:warn_CRLF_LF) op: Equal rhs: {(DQ ('CRLF will be replaced by LF'))} ) ] ) (command.If arms: [ (if_arm cond: [(C {(test_have_prereq)} {(NATIVE_CRLF)})] action: [ (command.Assignment keyword: Assign_None pairs: [(assign_pair lhs:(lhs_expr.LhsName name:WILC) op:Equal rhs:{(LF_CRLF)})] ) (command.Assignment keyword: Assign_None pairs: [(assign_pair lhs:(lhs_expr.LhsName name:WICL) op:Equal rhs:(word.EmptyWord))] ) (command.Assignment keyword: Assign_None pairs: [(assign_pair lhs:(lhs_expr.LhsName name:WAMIX) op:Equal rhs:{(LF_CRLF)})] ) ] ) ] else_action: [ (command.Assignment keyword: Assign_None pairs: [(assign_pair lhs:(lhs_expr.LhsName name:WILC) op:Equal rhs:(word.EmptyWord))] ) (command.Assignment keyword: Assign_None pairs: [(assign_pair lhs:(lhs_expr.LhsName name:WICL) op:Equal rhs:{(CRLF_LF)})] ) (command.Assignment keyword: Assign_None pairs: [(assign_pair lhs:(lhs_expr.LhsName name:WAMIX) op:Equal rhs:{(CRLF_LF)})] ) ] ) (C {(test_expect_success)} {(SQ <'commit files empty attr'>)} { (SQ <'\n'> <'\tcommit_check_warn false "" "" "" "" "" "" &&\n'> <'\tcommit_check_warn true "" "LF_CRLF" "" "LF_CRLF" "" "" &&\n'> <'\tcommit_check_warn input "" "" "CRLF_LF" "CRLF_LF" "" ""\n'> ) } ) (C {(test_expect_success)} {(SQ <'commit files attr=auto'>)} { (SQ <'\n'> <'\tcommit_check_warn false "auto" "$WILC" "$WICL" "$WAMIX" "" "" &&\n'> <'\tcommit_check_warn true "auto" "LF_CRLF" "" "LF_CRLF" "" "" &&\n'> <'\tcommit_check_warn input "auto" "" "CRLF_LF" "CRLF_LF" "" ""\n'> ) } ) (C {(test_expect_success)} {(SQ <'commit files attr=text'>)} { (SQ <'\n'> < '\tcommit_check_warn false "text" "$WILC" "$WICL" "$WAMIX" "$WILC" "$WICL" &&\n' > <'\tcommit_check_warn true "text" "LF_CRLF" "" "LF_CRLF" "LF_CRLF" "" &&\n'> <'\tcommit_check_warn input "text" "" "CRLF_LF" "CRLF_LF" "" "CRLF_LF"\n'> ) } ) (C {(test_expect_success)} {(SQ <'commit files attr=-text'>)} { (SQ <'\n'> <'\tcommit_check_warn false "-text" "" "" "" "" "" &&\n'> <'\tcommit_check_warn true "-text" "" "" "" "" "" &&\n'> <'\tcommit_check_warn input "-text" "" "" "" "" ""\n'> ) } ) (C {(test_expect_success)} {(SQ <'commit files attr=lf'>)} { (SQ <'\n'> < '\tcommit_check_warn false "lf" "" "CRLF_LF" "CRLF_LF" "" "CRLF_LF" &&\n' > <'\tcommit_check_warn true "lf" "" "CRLF_LF" "CRLF_LF" "" "CRLF_LF" &&\n'> <'\tcommit_check_warn input "lf" "" "CRLF_LF" "CRLF_LF" "" "CRLF_LF"\n'> ) } ) (C {(test_expect_success)} {(SQ <'commit files attr=crlf'>)} { (SQ <'\n'> <'\tcommit_check_warn false "crlf" "LF_CRLF" "" "LF_CRLF" "LF_CRLF" "" &&\n'> <'\tcommit_check_warn true "crlf" "LF_CRLF" "" "LF_CRLF" "LF_CRLF" "" &&\n'> <'\tcommit_check_warn input "crlf" "LF_CRLF" "" "LF_CRLF" "LF_CRLF" ""\n'> ) } ) (C {(commit_chk_wrnNNO)} {(DQ )} {(DQ )} {(false)} {(DQ )} {(DQ )} {(DQ )} {(DQ )} {(DQ )}) (C {(commit_chk_wrnNNO)} {(DQ )} {(DQ )} {(true)} {(LF_CRLF)} {(DQ )} {(DQ )} {(DQ )} {(DQ )}) (C {(commit_chk_wrnNNO)} {(DQ )} {(DQ )} {(input)} {(DQ )} {(DQ )} {(DQ )} {(DQ )} {(DQ )}) (C {(commit_chk_wrnNNO)} {(DQ (auto))} {(DQ )} {(false)} {(DQ ($ VSub_DollarName '$WILC'))} {(DQ )} {(DQ )} {(DQ )} {(DQ )}) (C {(commit_chk_wrnNNO)} {(DQ (auto))} {(DQ )} {(true)} {(LF_CRLF)} {(DQ )} {(DQ )} {(DQ )} {(DQ )}) (C {(commit_chk_wrnNNO)} {(DQ (auto))} {(DQ )} {(input)} {(DQ )} {(DQ )} {(DQ )} {(DQ )} {(DQ )}) (command.ForEach iter_name: crlf iter_words: [{(true)} {(false)} {(input)}] do_arg_iter: F body: (command.DoGroup children: [ (C {(commit_chk_wrnNNO)} {(-text)} {(DQ )} {($ VSub_DollarName '$crlf')} {(DQ )} {(DQ )} {(DQ )} {(DQ )} {(DQ )}) (C {(commit_chk_wrnNNO)} {(-text)} {(lf)} {($ VSub_DollarName '$crlf')} {(DQ )} {(DQ )} {(DQ )} {(DQ )} {(DQ )}) (C {(commit_chk_wrnNNO)} {(-text)} {(crlf)} {($ VSub_DollarName '$crlf')} {(DQ )} {(DQ )} {(DQ )} {(DQ )} {(DQ )}) (C {(commit_chk_wrnNNO)} {(DQ )} {(lf)} {($ VSub_DollarName '$crlf')} {(DQ )} {(CRLF_LF)} {(CRLF_LF)} {(DQ )} {(CRLF_LF)} ) (C {(commit_chk_wrnNNO)} {(DQ )} {(crlf)} {($ VSub_DollarName '$crlf')} {(LF_CRLF)} {(DQ )} {(LF_CRLF)} {(LF_CRLF)} {(DQ )} ) (C {(commit_chk_wrnNNO)} {(auto)} {(lf)} {($ VSub_DollarName '$crlf')} {(DQ )} {(DQ )} {(DQ )} {(DQ )} {(DQ )}) (C {(commit_chk_wrnNNO)} {(auto)} {(crlf)} {($ VSub_DollarName '$crlf')} {(LF_CRLF)} {(DQ )} {(DQ )} {(DQ )} {(DQ )}) (C {(commit_chk_wrnNNO)} {(text)} {(lf)} {($ VSub_DollarName '$crlf')} {(DQ )} {(CRLF_LF)} {(CRLF_LF)} {(DQ )} {(CRLF_LF)} ) (C {(commit_chk_wrnNNO)} {(text)} {(crlf)} {($ VSub_DollarName '$crlf')} {(LF_CRLF)} {(DQ )} {(LF_CRLF)} {(LF_CRLF)} {(DQ )} ) ] ) ) (C {(commit_chk_wrnNNO)} {(DQ (text))} {(DQ )} {(false)} {(DQ ($ VSub_DollarName '$WILC'))} {(DQ ($ VSub_DollarName '$WICL'))} {(DQ ($ VSub_DollarName '$WAMIX'))} {(DQ ($ VSub_DollarName '$WILC'))} {(DQ ($ VSub_DollarName '$WICL'))} ) (C {(commit_chk_wrnNNO)} {(DQ (text))} {(DQ )} {(true)} {(LF_CRLF)} {(DQ )} {(LF_CRLF)} {(LF_CRLF)} {(DQ )}) (C {(commit_chk_wrnNNO)} {(DQ (text))} {(DQ )} {(input)} {(DQ )} {(CRLF_LF)} {(CRLF_LF)} {(DQ )} {(CRLF_LF)} ) (C {(test_expect_success)} {(SQ <'commit NNO and cleanup'>)} { (SQ <'\n'> <'\tgit commit -m "commit files on top of NNO" &&\n'> <'\trm -f *.txt &&\n'> <'\tgit -c core.autocrlf=false reset --hard\n'> ) } ) (C {(test_expect_success)} {(SQ <'commit empty gitattribues'>)} { (SQ <'\n'> <'\tcheck_files_in_repo false "" LF CRLF CRLF_mix_LF LF_mix_CR CRLF_nul &&\n'> <'\tcheck_files_in_repo true "" LF LF LF LF_mix_CR CRLF_nul &&\n'> <'\tcheck_files_in_repo input "" LF LF LF LF_mix_CR CRLF_nul\n'> ) } ) (C {(test_expect_success)} {(SQ <'commit text=auto'>)} { (SQ <'\n'> <'\tcheck_files_in_repo false "auto" LF LF LF LF_mix_CR CRLF_nul &&\n'> <'\tcheck_files_in_repo true "auto" LF LF LF LF_mix_CR CRLF_nul &&\n'> <'\tcheck_files_in_repo input "auto" LF LF LF LF_mix_CR CRLF_nul\n'> ) } ) (C {(test_expect_success)} {(SQ <'commit text'>)} { (SQ <'\n'> <'\tcheck_files_in_repo false "text" LF LF LF LF_mix_CR LF_nul &&\n'> <'\tcheck_files_in_repo true "text" LF LF LF LF_mix_CR LF_nul &&\n'> <'\tcheck_files_in_repo input "text" LF LF LF LF_mix_CR LF_nul\n'> ) } ) (C {(test_expect_success)} {(SQ <'commit -text'>)} { (SQ <'\n'> <'\tcheck_files_in_repo false "-text" LF CRLF CRLF_mix_LF LF_mix_CR CRLF_nul &&\n'> <'\tcheck_files_in_repo true "-text" LF CRLF CRLF_mix_LF LF_mix_CR CRLF_nul &&\n'> <'\tcheck_files_in_repo input "-text" LF CRLF CRLF_mix_LF LF_mix_CR CRLF_nul\n'> ) } ) (command.ForEach iter_name: crlf iter_words: [{(true)} {(false)} {(input)}] do_arg_iter: F body: (command.DoGroup children: [ (C {(check_in_repo_NNO)} {(DQ )} {(DQ )} {($ VSub_DollarName '$crlf')} {(LF)} {(CRLF)} {(CRLF_mix_LF)} {(LF_mix_CR)} {(CRLF_nul)} ) (C {(check_in_repo_NNO)} {(-text)} {(DQ )} {($ VSub_DollarName '$crlf')} {(LF)} {(CRLF)} {(CRLF_mix_LF)} {(LF_mix_CR)} {(CRLF_nul)} ) (C {(check_in_repo_NNO)} {(-text)} {(lf)} {($ VSub_DollarName '$crlf')} {(LF)} {(CRLF)} {(CRLF_mix_LF)} {(LF_mix_CR)} {(CRLF_nul)} ) (C {(check_in_repo_NNO)} {(-text)} {(crlf)} {($ VSub_DollarName '$crlf')} {(LF)} {(CRLF)} {(CRLF_mix_LF)} {(LF_mix_CR)} {(CRLF_nul)} ) (C {(check_in_repo_NNO)} {(auto)} {(DQ )} {($ VSub_DollarName '$crlf')} {(LF)} {(CRLF)} {(CRLF_mix_LF)} {(LF_mix_CR)} {(CRLF_nul)} ) (C {(check_in_repo_NNO)} {(auto)} {(lf)} {($ VSub_DollarName '$crlf')} {(LF)} {(CRLF)} {(CRLF_mix_LF)} {(LF_mix_CR)} {(CRLF_nul)} ) (C {(check_in_repo_NNO)} {(auto)} {(crlf)} {($ VSub_DollarName '$crlf')} {(LF)} {(CRLF)} {(CRLF_mix_LF)} {(LF_mix_CR)} {(CRLF_nul)} ) (C {(check_in_repo_NNO)} {(text)} {(DQ )} {($ VSub_DollarName '$crlf')} {(LF)} {(LF)} {(LF)} {(LF_mix_CR)} {(LF_nul)} ) (C {(check_in_repo_NNO)} {(text)} {(lf)} {($ VSub_DollarName '$crlf')} {(LF)} {(LF)} {(LF)} {(LF_mix_CR)} {(LF_nul)} ) (C {(check_in_repo_NNO)} {(text)} {(crlf)} {($ VSub_DollarName '$crlf')} {(LF)} {(LF)} {(LF)} {(LF_mix_CR)} {(LF_nul)} ) ] ) ) (command.If arms: [ (if_arm cond: [(C {(test_have_prereq)} {(NATIVE_CRLF)})] action: [ (command.Assignment keyword: Assign_None pairs: [(assign_pair lhs:(lhs_expr.LhsName name:MIX_CRLF_LF) op:Equal rhs:{(CRLF)})] ) (command.Assignment keyword: Assign_None pairs: [(assign_pair lhs:(lhs_expr.LhsName name:MIX_LF_CR) op:Equal rhs:{(CRLF_mix_CR)})] ) (command.Assignment keyword: Assign_None pairs: [(assign_pair lhs:(lhs_expr.LhsName name:NL) op:Equal rhs:{(CRLF)})] ) (command.Assignment keyword: Assign_None pairs: [(assign_pair lhs:(lhs_expr.LhsName name:LFNUL) op:Equal rhs:{(CRLF_nul)})] ) ] ) ] else_action: [ (command.Assignment keyword: Assign_None pairs: [(assign_pair lhs:(lhs_expr.LhsName name:MIX_CRLF_LF) op:Equal rhs:{(CRLF_mix_LF)})] ) (command.Assignment keyword: Assign_None pairs: [(assign_pair lhs:(lhs_expr.LhsName name:MIX_LF_CR) op:Equal rhs:{(LF_mix_CR)})] ) (command.Assignment keyword: Assign_None pairs: [(assign_pair lhs:(lhs_expr.LhsName name:NL) op:Equal rhs:{(LF)})] ) (command.Assignment keyword: Assign_None pairs: [(assign_pair lhs:(lhs_expr.LhsName name:LFNUL) op:Equal rhs:{(LF_nul)})] ) ] ) (C {(export)} {(CRLF_MIX_LF_CR)} {(MIX)} {(NL)}) (command.ForEach iter_name: id iter_words: [{(DQ )} {(ident)}] do_arg_iter: F body: (command.DoGroup children: [ (command.ForEach iter_name: ceol iter_words: [{(lf)} {(crlf)} {(native)}] do_arg_iter: F body: (command.DoGroup children: [ (command.ForEach iter_name: crlf iter_words: [{(true)} {(false)} {(input)}] do_arg_iter: F body: (command.DoGroup children: [ (C {(checkout_files)} {(-text)} {(DQ ($ VSub_DollarName '$id'))} {(DQ )} {(DQ ($ VSub_DollarName '$crlf'))} {(DQ ($ VSub_DollarName '$ceol'))} {(LF)} {(CRLF)} {(CRLF_mix_LF)} {(LF_mix_CR)} {(LF_nul)} ) (C {(checkout_files)} {(-text)} {(DQ ($ VSub_DollarName '$id'))} {(DQ (lf))} {(DQ ($ VSub_DollarName '$crlf'))} {(DQ ($ VSub_DollarName '$ceol'))} {(LF)} {(CRLF)} {(CRLF_mix_LF)} {(LF_mix_CR)} {(LF_nul)} ) (C {(checkout_files)} {(-text)} {(DQ ($ VSub_DollarName '$id'))} {(DQ (crlf))} {(DQ ($ VSub_DollarName '$crlf'))} {(DQ ($ VSub_DollarName '$ceol'))} {(LF)} {(CRLF)} {(CRLF_mix_LF)} {(LF_mix_CR)} {(LF_nul)} ) (C {(checkout_files)} {(text)} {(DQ ($ VSub_DollarName '$id'))} {(DQ (lf))} {(DQ ($ VSub_DollarName '$crlf'))} {(DQ ($ VSub_DollarName '$ceol'))} {(LF)} {(CRLF)} {(CRLF_mix_LF)} {(LF_mix_CR)} {(LF_nul)} ) (C {(checkout_files)} {(text)} {(DQ ($ VSub_DollarName '$id'))} {(DQ (crlf))} {(DQ ($ VSub_DollarName '$crlf'))} {(DQ ($ VSub_DollarName '$ceol'))} {(CRLF)} {(CRLF)} {(CRLF)} {(CRLF_mix_CR)} {(CRLF_nul)} ) (C {(checkout_files)} {(auto)} {(DQ ($ VSub_DollarName '$id'))} {(DQ (lf))} {(DQ ($ VSub_DollarName '$crlf'))} {(DQ ($ VSub_DollarName '$ceol'))} {(LF)} {(CRLF)} {(CRLF_mix_LF)} {(LF_mix_CR)} {(LF_nul)} ) (C {(checkout_files)} {(auto)} {(DQ ($ VSub_DollarName '$id'))} {(DQ (crlf))} {(DQ ($ VSub_DollarName '$crlf'))} {(DQ ($ VSub_DollarName '$ceol'))} {(CRLF)} {(CRLF)} {(CRLF_mix_LF)} {(LF_mix_CR)} {(LF_nul)} ) ] ) ) (C {(checkout_files)} {(DQ )} {(DQ ($ VSub_DollarName '$id'))} {(DQ )} {(false)} {(DQ ($ VSub_DollarName '$ceol'))} {(LF)} {(CRLF)} {(CRLF_mix_LF)} {(LF_mix_CR)} {(LF_nul)} ) (C {(checkout_files)} {(DQ )} {(DQ ($ VSub_DollarName '$id'))} {(DQ )} {(true)} {(DQ ($ VSub_DollarName '$ceol'))} {(CRLF)} {(CRLF)} {(CRLF_mix_LF)} {(LF_mix_CR)} {(LF_nul)} ) (C {(checkout_files)} {(auto)} {(DQ ($ VSub_DollarName '$id'))} {(DQ )} {(true)} {(DQ ($ VSub_DollarName '$ceol'))} {(CRLF)} {(CRLF)} {(CRLF_mix_LF)} {(LF_mix_CR)} {(LF_nul)} ) (C {(checkout_files)} {(text)} {(DQ ($ VSub_DollarName '$id'))} {(DQ )} {(true)} {(DQ ($ VSub_DollarName '$ceol'))} {(CRLF)} {(CRLF)} {(CRLF)} {(CRLF_mix_CR)} {(CRLF_nul)} ) (C {(checkout_files)} {(text)} {(DQ ($ VSub_DollarName '$id'))} {(DQ )} {(input)} {(DQ ($ VSub_DollarName '$ceol'))} {(LF)} {(CRLF)} {(CRLF_mix_LF)} {(LF_mix_CR)} {(LF_nul)} ) (C {(checkout_files)} {(auto)} {(DQ ($ VSub_DollarName '$id'))} {(DQ )} {(input)} {(DQ ($ VSub_DollarName '$ceol'))} {(LF)} {(CRLF)} {(CRLF_mix_LF)} {(LF_mix_CR)} {(LF_nul)} ) ] ) ) (C {(checkout_files)} {(text)} {(DQ ($ VSub_DollarName '$id'))} {(DQ )} {(false)} {(crlf)} {(CRLF)} {(CRLF)} {(CRLF)} {(CRLF_mix_CR)} {(CRLF_nul)} ) (C {(checkout_files)} {(text)} {(DQ ($ VSub_DollarName '$id'))} {(DQ )} {(false)} {(lf)} {(LF)} {(CRLF)} {(CRLF_mix_LF)} {(LF_mix_CR)} {(LF_nul)} ) (C {(checkout_files)} {(text)} {(DQ ($ VSub_DollarName '$id'))} {(DQ )} {(false)} {(DQ )} {($ VSub_DollarName '$NL')} {(CRLF)} {($ VSub_DollarName '$MIX_CRLF_LF')} {($ VSub_DollarName '$MIX_LF_CR')} {($ VSub_DollarName '$LFNUL')} ) (C {(checkout_files)} {(text)} {(DQ ($ VSub_DollarName '$id'))} {(DQ )} {(false)} {(native)} {($ VSub_DollarName '$NL')} {(CRLF)} {($ VSub_DollarName '$MIX_CRLF_LF')} {($ VSub_DollarName '$MIX_LF_CR')} {($ VSub_DollarName '$LFNUL')} ) (C {(checkout_files)} {(auto)} {(DQ ($ VSub_DollarName '$id'))} {(DQ )} {(false)} {(DQ )} {($ VSub_DollarName '$NL')} {(CRLF)} {(CRLF_mix_LF)} {(LF_mix_CR)} {(LF_nul)} ) (C {(checkout_files)} {(auto)} {(DQ ($ VSub_DollarName '$id'))} {(DQ )} {(false)} {(native)} {($ VSub_DollarName '$NL')} {(CRLF)} {(CRLF_mix_LF)} {(LF_mix_CR)} {(LF_nul)} ) ] ) ) (C {(test_expect_success)} {(SQ <'ls-files --eol -d -z'>)} { (SQ <'\n'> < '\trm crlf_false_attr__CRLF.txt crlf_false_attr__CRLF_mix_LF.txt crlf_false_attr__LF.txt .gitattributes &&\n' > <'\tcat >expect <<-\\EOF &&\n'> <'\ti/crlf w/ crlf_false_attr__CRLF.txt\n'> <'\ti/lf w/ .gitattributes\n'> <'\ti/lf w/ crlf_false_attr__LF.txt\n'> <'\ti/mixed w/ crlf_false_attr__CRLF_mix_LF.txt\n'> <'\tEOF\n'> <'\tgit ls-files --eol -d |\n'> <'\tsed -e "s!attr/[^\t]*!!g" -e "s/\t/ /g" -e "s/ */ /g" |\n'> <'\tsort >actual &&\n'> <'\ttest_cmp expect actual\n'> ) } ) (C {(test_done)}) ] )