(command.CommandList children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:USAGE) op: Equal rhs: { (SQ < '[--tool=tool] [--tool-help] [-y|--no-prompt|--prompt] [-O<orderfile>] [file to merge] ...' > ) } ) ] ) (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:SUBDIRECTORY_OK) op:Equal rhs:{(Yes)})] ) (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:NONGIT_OK) op:Equal rhs:{(Yes)})] ) (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:OPTIONS_SPEC) op:Equal rhs:(word.Empty))] ) (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:TOOL_MODE) op:Equal rhs:{(merge)})] ) (C {(.)} {(git-sh-setup)}) (C {(.)} {(git-mergetool--lib)}) (command.ShFunction name: is_symlink body: (command.BraceGroup children: [(C {(test)} {(DQ ($ VSub_Number '$1'))} {(Lit_Equals '=')} {(120000)})] ) ) (command.ShFunction name: is_submodule body: (command.BraceGroup children: [(C {(test)} {(DQ ($ VSub_Number '$1'))} {(Lit_Equals '=')} {(160000)})] ) ) (command.ShFunction name: local_present body: (command.BraceGroup children: [(C {(test)} {(-n)} {(DQ ($ VSub_DollarName '$local_mode'))})] ) ) (command.ShFunction name: remote_present body: (command.BraceGroup children: [(C {(test)} {(-n)} {(DQ ($ VSub_DollarName '$remote_mode'))})] ) ) (command.ShFunction name: base_present body: (command.BraceGroup children: [(C {(test)} {(-n)} {(DQ ($ VSub_DollarName '$base_mode'))})] ) ) (command.ShFunction name: mergetool_tmpdir_init body: (command.BraceGroup children: [ (command.If arms: [ (if_arm cond: [ (C {(test)} { (DQ (command_sub left_token: <Left_DollarParen '$('> command_list: (command.CommandList children: [(C {(git)} {(config)} {(--bool)} {(mergetool.writeToTemp)})] ) ) ) } {(KW_Bang '!') (Lit_Equals '=')} {(true)} ) ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:MERGETOOL_TMPDIR) op: Equal rhs: {(.)} ) ] ) (command.ControlFlow token: <ControlFlow_Return return> arg_word: {(0)} ) ] ) ] ) (command.If arms: [ (if_arm cond: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:MERGETOOL_TMPDIR) op: Equal rhs: { (command_sub left_token: <Left_DollarParen '$('> command_list: (command.CommandList children: [ (command.Simple words: [{(mktemp)} {(-d)} {(-t)} {(DQ (git-mergetool-XXXXXX))}] redirects: [ (redir.Redir op: <Redir_Great '2>'> fd: 2 arg_word: {(/dev/null)} ) ] ) ] ) ) } ) ] ) ] action: [(command.ControlFlow token:<ControlFlow_Return return> arg_word:{(0)})] ) ] ) (C {(die)} {(DQ ("error: mktemp is needed when 'mergetool.writeToTemp' is true"))}) ] ) ) (command.ShFunction name: cleanup_temp_files body: (command.BraceGroup children: [ (command.If arms: [ (if_arm cond: [(C {(test)} {(DQ ($ VSub_Number '$1'))} {(Lit_Equals '=')} {(--save-backup)})] action: [ (C {(rm)} {(-rf)} {(--)} {(DQ ($ VSub_DollarName '$MERGED') (.orig))}) (command.AndOr ops: [Op_DAmp] children: [ (C {(test)} {(-e)} {(DQ ($ VSub_DollarName '$BACKUP'))}) (C {(mv)} {(--)} {(DQ ($ VSub_DollarName '$BACKUP'))} {(DQ ($ VSub_DollarName '$MERGED') (.orig))} ) ] ) (C {(rm)} {(-f)} {(--)} {(DQ ($ VSub_DollarName '$LOCAL'))} {(DQ ($ VSub_DollarName '$REMOTE'))} {(DQ ($ VSub_DollarName '$BASE'))} ) ] ) ] else_action: [ (C {(rm)} {(-f)} {(--)} {(DQ ($ VSub_DollarName '$LOCAL'))} {(DQ ($ VSub_DollarName '$REMOTE'))} {(DQ ($ VSub_DollarName '$BASE'))} {(DQ ($ VSub_DollarName '$BACKUP'))} ) ] ) (command.If arms: [ (if_arm cond: [ (C {(test)} {(DQ ($ VSub_DollarName '$MERGETOOL_TMPDIR'))} {(KW_Bang '!') (Lit_Equals '=')} {(DQ (.))} ) ] action: [(C {(rmdir)} {(DQ ($ VSub_DollarName '$MERGETOOL_TMPDIR'))})] ) ] ) ] ) ) (command.ShFunction name: describe_file body: (command.BraceGroup children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:mode) op: Equal rhs: {(DQ ($ VSub_Number '$1'))} ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:branch) op: Equal rhs: {(DQ ($ VSub_Number '$2'))} ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:file) op: Equal rhs: {(DQ ($ VSub_Number '$3'))} ) ] ) (C {(printf)} {(DQ (' {%s}: '))} {(DQ ($ VSub_DollarName '$branch'))}) (command.If arms: [ (if_arm cond: [(C {(test)} {(-z)} {(DQ ($ VSub_DollarName '$mode'))})] action: [(C {(echo)} {(DQ (deleted))})] ) (if_arm cond: [(C {(is_symlink)} {(DQ ($ VSub_DollarName '$mode'))})] action: [ (C {(echo)} { (DQ ("a symbolic link -> '") (command_sub left_token: <Left_DollarParen '$('> command_list: (command.CommandList children: [(C {(cat)} {(DQ ($ VSub_DollarName '$file'))})] ) ) ("'") ) } ) ] ) (if_arm cond: [(C {(is_submodule)} {(DQ ($ VSub_DollarName '$mode'))})] action: [(C {(echo)} {(DQ ('submodule commit ') ($ VSub_DollarName '$file'))})] ) (if_arm cond: [(C {(base_present)})] action: [(C {(echo)} {(DQ ('modified file'))})] ) ] else_action: [(C {(echo)} {(DQ ('created file'))})] ) ] ) ) (command.ShFunction name: resolve_symlink_merge body: (command.BraceGroup children: [ (command.WhileUntil keyword: <KW_While while> cond: [(C {(true)})] body: (command.DoGroup children: [ (C {(printf)} {(DQ ('Use (l)ocal or (r)emote, or (a)bort? '))}) (command.AndOr ops: [Op_DPipe] children: [ (C {(read)} {(ans)}) (command.ControlFlow token: <ControlFlow_Return return> arg_word: {(1)} ) ] ) (command.Case to_match: {(DQ ($ VSub_DollarName '$ans'))} arms: [ (case_arm pat_list: [{(Lit_LBracket '[') (lL) (Lit_RBracket ']') (Lit_Star '*')}] action: [ (C {(git)} {(checkout-index)} {(-f)} {(--stage) (Lit_Equals '=') (2)} {(--)} {(DQ ($ VSub_DollarName '$MERGED'))} ) (C {(git)} {(add)} {(--)} {(DQ ($ VSub_DollarName '$MERGED'))}) (C {(cleanup_temp_files)} {(--save-backup)}) (command.ControlFlow token: <ControlFlow_Return return> arg_word: {(0)} ) ] ) (case_arm pat_list: [{(Lit_LBracket '[') (rR) (Lit_RBracket ']') (Lit_Star '*')}] action: [ (C {(git)} {(checkout-index)} {(-f)} {(--stage) (Lit_Equals '=') (3)} {(--)} {(DQ ($ VSub_DollarName '$MERGED'))} ) (C {(git)} {(add)} {(--)} {(DQ ($ VSub_DollarName '$MERGED'))}) (C {(cleanup_temp_files)} {(--save-backup)}) (command.ControlFlow token: <ControlFlow_Return return> arg_word: {(0)} ) ] ) (case_arm pat_list: [{(Lit_LBracket '[') (aA) (Lit_RBracket ']') (Lit_Star '*')}] action: [ (command.ControlFlow token: <ControlFlow_Return return> arg_word: {(1)} ) ] ) ] ) ] ) ) ] ) ) (command.ShFunction name: resolve_deleted_merge body: (command.BraceGroup children: [ (command.WhileUntil keyword: <KW_While while> cond: [(C {(true)})] body: (command.DoGroup children: [ (command.If arms: [ (if_arm cond: [(C {(base_present)})] action: [ (C {(printf)} {(DQ ('Use (m)odified or (d)eleted file, or (a)bort? '))}) ] ) ] else_action: [ (C {(printf)} {(DQ ('Use (c)reated or (d)eleted file, or (a)bort? '))}) ] ) (command.AndOr ops: [Op_DPipe] children: [ (C {(read)} {(ans)}) (command.ControlFlow token: <ControlFlow_Return return> arg_word: {(1)} ) ] ) (command.Case to_match: {(DQ ($ VSub_DollarName '$ans'))} arms: [ (case_arm pat_list: [{(Lit_LBracket '[') (mMcC) (Lit_RBracket ']') (Lit_Star '*')}] action: [ (C {(git)} {(add)} {(--)} {(DQ ($ VSub_DollarName '$MERGED'))}) (command.If arms: [ (if_arm cond: [ (C {(test)} {(DQ ($ VSub_DollarName '$merge_keep_backup'))} {(Lit_Equals '=')} {(DQ (true))} ) ] action: [(C {(cleanup_temp_files)} {(--save-backup)})] ) ] else_action: [(C {(cleanup_temp_files)})] ) (command.ControlFlow token: <ControlFlow_Return return> arg_word: {(0)} ) ] ) (case_arm pat_list: [{(Lit_LBracket '[') (dD) (Lit_RBracket ']') (Lit_Star '*')}] action: [ (command.Simple words: [{(git)} {(rm)} {(--)} {(DQ ($ VSub_DollarName '$MERGED'))}] redirects: [ (redir.Redir op: <Redir_Great '>'> fd: 16777215 arg_word: {(/dev/null)} ) ] ) (C {(cleanup_temp_files)}) (command.ControlFlow token: <ControlFlow_Return return> arg_word: {(0)} ) ] ) (case_arm pat_list: [{(Lit_LBracket '[') (aA) (Lit_RBracket ']') (Lit_Star '*')}] action: [ (command.If arms: [ (if_arm cond: [ (C {(test)} {(DQ ($ VSub_DollarName '$merge_keep_temporaries'))} {(Lit_Equals '=')} {(DQ (false))} ) ] action: [(C {(cleanup_temp_files)})] ) ] ) (command.ControlFlow token: <ControlFlow_Return return> arg_word: {(1)} ) ] ) ] ) ] ) ) ] ) ) (command.ShFunction name: resolve_submodule_merge body: (command.BraceGroup children: [ (command.WhileUntil keyword: <KW_While while> cond: [(C {(true)})] body: (command.DoGroup children: [ (C {(printf)} {(DQ ('Use (l)ocal or (r)emote, or (a)bort? '))}) (command.AndOr ops: [Op_DPipe] children: [ (C {(read)} {(ans)}) (command.ControlFlow token: <ControlFlow_Return return> arg_word: {(1)} ) ] ) (command.Case to_match: {(DQ ($ VSub_DollarName '$ans'))} arms: [ (case_arm pat_list: [{(Lit_LBracket '[') (lL) (Lit_RBracket ']') (Lit_Star '*')}] action: [ (command.If arms: [ (if_arm cond: [ (command.Pipeline children: [(C {(local_present)})] negated: T ) ] action: [ (command.If arms: [ (if_arm cond: [ (C {(test)} {(-n)} { (DQ (command_sub left_token: <Left_DollarParen '$('> command_list: (command.CommandList children: [ (C {(git)} {(ls-tree)} {(HEAD)} {(--)} {(DQ ($ VSub_DollarName '$MERGED'))} ) ] ) ) ) } ) ] action: [ (command.AndOr ops: [Op_DPipe] children: [ (command.Pipeline children: [ (C {(git)} {(ls-tree)} {(--full-name)} {(-r)} {(HEAD)} {(--)} {(DQ ($ VSub_DollarName '$MERGED'))} ) (C {(git)} {(update-index)} {(--index-info)}) ] negated: F ) (command.ControlFlow token: <ControlFlow_Exit exit> arg_word: {($ VSub_QMark '$?')} ) ] ) ] ) ] else_action: [ (command.AndOr ops: [Op_DAmp] children: [ (C {(test)} {(-e)} {(DQ ($ VSub_DollarName '$MERGED'))}) (C {(mv)} {(--)} {(DQ ($ VSub_DollarName '$MERGED'))} {(DQ ($ VSub_DollarName '$BACKUP'))} ) ] ) (C {(git)} {(update-index)} {(--force-remove)} {(DQ ($ VSub_DollarName '$MERGED'))} ) (C {(cleanup_temp_files)} {(--save-backup)}) ] ) ] ) (if_arm cond: [(C {(is_submodule)} {(DQ ($ VSub_DollarName '$local_mode'))})] action: [ (C {(stage_submodule)} {(DQ ($ VSub_DollarName '$MERGED'))} {(DQ ($ VSub_DollarName '$local_sha1'))} ) ] ) ] else_action: [ (C {(git)} {(checkout-index)} {(-f)} {(--stage) (Lit_Equals '=') (2)} {(--)} {(DQ ($ VSub_DollarName '$MERGED'))} ) (C {(git)} {(add)} {(--)} {(DQ ($ VSub_DollarName '$MERGED'))}) ] ) (command.ControlFlow token: <ControlFlow_Return return> arg_word: {(0)} ) ] ) (case_arm pat_list: [{(Lit_LBracket '[') (rR) (Lit_RBracket ']') (Lit_Star '*')}] action: [ (command.If arms: [ (if_arm cond: [ (command.Pipeline children: [(C {(remote_present)})] negated: T ) ] action: [ (command.If arms: [ (if_arm cond: [ (C {(test)} {(-n)} { (DQ (command_sub left_token: <Left_DollarParen '$('> command_list: (command.CommandList children: [ (C {(git)} {(ls-tree)} {(MERGE_HEAD)} {(--)} {(DQ ($ VSub_DollarName '$MERGED'))} ) ] ) ) ) } ) ] action: [ (command.AndOr ops: [Op_DPipe] children: [ (command.Pipeline children: [ (C {(git)} {(ls-tree)} {(--full-name)} {(-r)} {(MERGE_HEAD)} {(--)} {(DQ ($ VSub_DollarName '$MERGED'))} ) (C {(git)} {(update-index)} {(--index-info)}) ] negated: F ) (command.ControlFlow token: <ControlFlow_Exit exit> arg_word: {($ VSub_QMark '$?')} ) ] ) ] ) ] else_action: [ (command.AndOr ops: [Op_DAmp] children: [ (C {(test)} {(-e)} {(DQ ($ VSub_DollarName '$MERGED'))}) (C {(mv)} {(--)} {(DQ ($ VSub_DollarName '$MERGED'))} {(DQ ($ VSub_DollarName '$BACKUP'))} ) ] ) (C {(git)} {(update-index)} {(--force-remove)} {(DQ ($ VSub_DollarName '$MERGED'))} ) ] ) ] ) (if_arm cond: [(C {(is_submodule)} {(DQ ($ VSub_DollarName '$remote_mode'))})] action: [ (command.AndOr ops: [Op_DAmp Op_DAmp] children: [ (command.Pipeline children: [ (C {(is_submodule)} {(DQ ($ VSub_DollarName '$local_mode'))}) ] negated: T ) (C {(test)} {(-e)} {(DQ ($ VSub_DollarName '$MERGED'))}) (C {(mv)} {(--)} {(DQ ($ VSub_DollarName '$MERGED'))} {(DQ ($ VSub_DollarName '$BACKUP'))} ) ] ) (C {(stage_submodule)} {(DQ ($ VSub_DollarName '$MERGED'))} {(DQ ($ VSub_DollarName '$remote_sha1'))} ) ] ) ] else_action: [ (command.AndOr ops: [Op_DAmp] children: [ (C {(test)} {(-e)} {(DQ ($ VSub_DollarName '$MERGED'))}) (C {(mv)} {(--)} {(DQ ($ VSub_DollarName '$MERGED'))} {(DQ ($ VSub_DollarName '$BACKUP'))} ) ] ) (C {(git)} {(checkout-index)} {(-f)} {(--stage) (Lit_Equals '=') (3)} {(--)} {(DQ ($ VSub_DollarName '$MERGED'))} ) (C {(git)} {(add)} {(--)} {(DQ ($ VSub_DollarName '$MERGED'))}) ] ) (C {(cleanup_temp_files)} {(--save-backup)}) (command.ControlFlow token: <ControlFlow_Return return> arg_word: {(0)} ) ] ) (case_arm pat_list: [{(Lit_LBracket '[') (aA) (Lit_RBracket ']') (Lit_Star '*')}] action: [ (command.ControlFlow token: <ControlFlow_Return return> arg_word: {(1)} ) ] ) ] ) ] ) ) ] ) ) (command.ShFunction name: stage_submodule body: (command.BraceGroup children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:path) op: Equal rhs: {(DQ ($ VSub_Number '$1'))} ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:submodule_sha1) op: Equal rhs: {(DQ ($ VSub_Number '$2'))} ) ] ) (command.AndOr ops: [Op_DPipe] children: [ (C {(mkdir)} {(-p)} {(DQ ($ VSub_DollarName '$path'))}) (C {(die)} { (DQ ('fatal: unable to create directory for module at ') ($ VSub_DollarName '$path') ) } ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:work_tree_root) op: Equal rhs: { (command_sub left_token: <Left_DollarParen '$('> command_list: (command.CommandList children: [ (command.AndOr ops: [Op_DAmp] children: [(C {(cd_to_toplevel)}) (C {(pwd)})] ) ] ) ) } ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:work_rel_path) op: Equal rhs: { (command_sub left_token: <Left_DollarParen '$('> command_list: (command.CommandList children: [ (command.AndOr ops: [Op_DAmp] children: [ (C {(cd)} {(DQ ($ VSub_DollarName '$path'))}) (command.Simple words: [{(git)} {(rev-parse)} {(--show-prefix)}] more_env: [ (env_pair name: GIT_WORK_TREE val: {(DQ (${ VSub_Name work_tree_root))} ) ] ) ] ) ] ) ) } ) ] ) (command.AndOr ops: [Op_DPipe] children: [ (C {(test)} {(-n)} {(DQ ($ VSub_DollarName '$work_rel_path'))}) (C {(die)} { (DQ ('fatal: unable to get path of module ') ($ VSub_DollarName '$path') (' relative to work tree') ) } ) ] ) (command.AndOr ops: [Op_DPipe] children: [ (C {(git)} {(update-index)} {(--add)} {(--replace)} {(--cacheinfo)} {(160000)} {(DQ ($ VSub_DollarName '$submodule_sha1'))} { (DQ (braced_var_sub token: <VSub_Name work_rel_path> suffix_op: (suffix_op.Unary op_id:VOp1_Percent arg_word:{(Lit_Slash /)}) ) ) } ) (C {(die)}) ] ) ] ) ) (command.ShFunction name: checkout_staged_file body: (command.BraceGroup children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:tmpfile) op: Equal rhs: { (command_sub left_token: <Left_DollarParen '$('> command_list: (command.CommandList children: [ (C {(expr)} { (DQ (command_sub left_token: <Left_DollarParen '$('> command_list: (command.CommandList children: [ (command.Simple words: [ {(git)} {(checkout-index)} {(--temp)} {(--stage) (Lit_Equals '=') (DQ ($ VSub_Number '$1'))} {(DQ ($ VSub_Number '$2'))} ] redirects: [ (redir.Redir op: <Redir_Great '2>'> fd: 2 arg_word: {(/dev/null)} ) ] ) ] ) ) ) } {(Lit_Other ':')} {(SQ <'\\([^\t]*\\)\t'>)} ) ] ) ) } ) ] ) (command.If arms: [ (if_arm cond: [ (command.AndOr ops: [Op_DAmp] children: [ (C {(test)} {($ VSub_QMark '$?')} {(-eq)} {(0)}) (C {(test)} {(-n)} {(DQ ($ VSub_DollarName '$tmpfile'))}) ] ) ] action: [ (C {(mv)} {(--)} { (DQ (command_sub left_token: <Left_DollarParen '$('> command_list: (command.CommandList children: [(C {(git)} {(rev-parse)} {(--show-cdup)})] ) ) ($ VSub_DollarName '$tmpfile') ) } {(DQ ($ VSub_Number '$3'))} ) ] ) ] else_action: [ (command.Simple redirects: [ (redir.Redir op: <Redir_Great '>'> fd: 16777215 arg_word: {(DQ ($ VSub_Number '$3'))} ) ] ) ] ) ] ) ) (command.ShFunction name: merge_file body: (command.BraceGroup children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:MERGED) op: Equal rhs: {(DQ ($ VSub_Number '$1'))} ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:f) op: Equal rhs: { (command_sub left_token: <Left_DollarParen '$('> command_list: (command.CommandList children: [ (C {(git)} {(ls-files)} {(-u)} {(--)} {(DQ ($ VSub_DollarName '$MERGED'))}) ] ) ) } ) ] ) (command.If arms: [ (if_arm cond: [(C {(test)} {(-z)} {(DQ ($ VSub_DollarName '$f'))})] action: [ (command.If arms: [ (if_arm cond: [ (C {(test)} {(KW_Bang '!')} {(-f)} {(DQ ($ VSub_DollarName '$MERGED'))}) ] action: [ (C {(echo)} {(DQ ($ VSub_DollarName '$MERGED') (': file not found'))}) ] ) ] else_action: [ (C {(echo)} {(DQ ($ VSub_DollarName '$MERGED') (': file does not need merging'))} ) ] ) (command.ControlFlow token: <ControlFlow_Return return> arg_word: {(1)} ) ] ) ] ) (command.If arms: [ (if_arm cond: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:BASE) op: Equal rhs: { (command_sub left_token: <Left_DollarParen '$('> command_list: (command.CommandList children: [ (C {(expr)} {(DQ ($ VSub_DollarName '$MERGED'))} {(Lit_Other ':')} {(SQ <'\\(.*\\)\\.[^/]*$'>)} ) ] ) ) } ) ] ) ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:ext) op: Equal rhs: { (command_sub left_token: <Left_DollarParen '$('> command_list: (command.CommandList children: [ (C {(expr)} {(DQ ($ VSub_DollarName '$MERGED'))} {(Lit_Other ':')} {(SQ <'.*\\(\\.[^/]*\\)$'>)} ) ] ) ) } ) ] ) ] ) ] else_action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:BASE) op: Equal rhs: {($ VSub_DollarName '$MERGED')} ) ] ) (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:ext) op:Equal rhs:(word.Empty))] ) ] ) (C {(mergetool_tmpdir_init)}) (command.If arms: [ (if_arm cond: [ (C {(test)} {(DQ ($ VSub_DollarName '$MERGETOOL_TMPDIR'))} {(KW_Bang '!') (Lit_Equals '=')} {(DQ (.))} ) ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:BASE) op: Equal rhs: { (braced_var_sub token: <VSub_Name BASE> suffix_op: (suffix_op.Unary op_id: VOp1_DPound arg_word: {('*') (Lit_Slash /)} ) ) } ) ] ) ] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:BACKUP) op: Equal rhs: { (DQ ($ VSub_DollarName '$MERGETOOL_TMPDIR') (/) (${ VSub_Name BASE) (_BACKUP_) ($ VSub_Dollar '$$') ($ VSub_DollarName '$ext') ) } ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:LOCAL) op: Equal rhs: { (DQ ($ VSub_DollarName '$MERGETOOL_TMPDIR') (/) (${ VSub_Name BASE) (_LOCAL_) ($ VSub_Dollar '$$') ($ VSub_DollarName '$ext') ) } ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:REMOTE) op: Equal rhs: { (DQ ($ VSub_DollarName '$MERGETOOL_TMPDIR') (/) (${ VSub_Name BASE) (_REMOTE_) ($ VSub_Dollar '$$') ($ VSub_DollarName '$ext') ) } ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:BASE) op: Equal rhs: { (DQ ($ VSub_DollarName '$MERGETOOL_TMPDIR') (/) (${ VSub_Name BASE) (_BASE_) ($ VSub_Dollar '$$') ($ VSub_DollarName '$ext') ) } ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:base_mode) op: Equal rhs: { (command_sub left_token: <Left_DollarParen '$('> command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {(git)} {(ls-files)} {(-u)} {(--)} {(DQ ($ VSub_DollarName '$MERGED'))} ) (C {(awk)} {(SQ <'{if ($3==1) print $1;}'>)}) ] negated: F ) ] ) ) } ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:local_mode) op: Equal rhs: { (command_sub left_token: <Left_DollarParen '$('> command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {(git)} {(ls-files)} {(-u)} {(--)} {(DQ ($ VSub_DollarName '$MERGED'))} ) (C {(awk)} {(SQ <'{if ($3==2) print $1;}'>)}) ] negated: F ) ] ) ) } ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:remote_mode) op: Equal rhs: { (command_sub left_token: <Left_DollarParen '$('> command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {(git)} {(ls-files)} {(-u)} {(--)} {(DQ ($ VSub_DollarName '$MERGED'))} ) (C {(awk)} {(SQ <'{if ($3==3) print $1;}'>)}) ] negated: F ) ] ) ) } ) ] ) (command.If arms: [ (if_arm cond: [ (command.AndOr ops: [Op_DPipe] children: [ (C {(is_submodule)} {(DQ ($ VSub_DollarName '$local_mode'))}) (C {(is_submodule)} {(DQ ($ VSub_DollarName '$remote_mode'))}) ] ) ] action: [ (C {(echo)} {(DQ ("Submodule merge conflict for '") ($ VSub_DollarName '$MERGED') ("':"))} ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:local_sha1) op: Equal rhs: { (command_sub left_token: <Left_DollarParen '$('> command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {(git)} {(ls-files)} {(-u)} {(--)} {(DQ ($ VSub_DollarName '$MERGED'))} ) (C {(awk)} {(SQ <'{if ($3==2) print $2;}'>)}) ] negated: F ) ] ) ) } ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:remote_sha1) op: Equal rhs: { (command_sub left_token: <Left_DollarParen '$('> command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {(git)} {(ls-files)} {(-u)} {(--)} {(DQ ($ VSub_DollarName '$MERGED'))} ) (C {(awk)} {(SQ <'{if ($3==3) print $2;}'>)}) ] negated: F ) ] ) ) } ) ] ) (C {(describe_file)} {(DQ ($ VSub_DollarName '$local_mode'))} {(DQ (local))} {(DQ ($ VSub_DollarName '$local_sha1'))} ) (C {(describe_file)} {(DQ ($ VSub_DollarName '$remote_mode'))} {(DQ (remote))} {(DQ ($ VSub_DollarName '$remote_sha1'))} ) (C {(resolve_submodule_merge)}) (command.ControlFlow token:<ControlFlow_Return return>) ] ) ] ) (command.If arms: [ (if_arm cond: [(C {(test)} {(-f)} {(DQ ($ VSub_DollarName '$MERGED'))})] action: [ (C {(mv)} {(--)} {(DQ ($ VSub_DollarName '$MERGED'))} {(DQ ($ VSub_DollarName '$BACKUP'))} ) (C {(cp)} {(--)} {(DQ ($ VSub_DollarName '$BACKUP'))} {(DQ ($ VSub_DollarName '$MERGED'))} ) ] ) ] ) (C {(mkdir)} {(-p)} { (DQ (command_sub left_token: <Left_DollarParen '$('> command_list: (command.CommandList children: [(C {(dirname)} {(DQ ($ VSub_DollarName '$MERGED'))})] ) ) ) } ) (C {(checkout_staged_file)} {(1)} {(DQ ($ VSub_DollarName '$MERGED'))} {(DQ ($ VSub_DollarName '$BASE'))} ) (C {(checkout_staged_file)} {(2)} {(DQ ($ VSub_DollarName '$MERGED'))} {(DQ ($ VSub_DollarName '$LOCAL'))} ) (C {(checkout_staged_file)} {(3)} {(DQ ($ VSub_DollarName '$MERGED'))} {(DQ ($ VSub_DollarName '$REMOTE'))} ) (command.If arms: [ (if_arm cond: [ (command.AndOr ops: [Op_DPipe] children: [ (C {(test)} {(-z)} {(DQ ($ VSub_DollarName '$local_mode'))}) (C {(test)} {(-z)} {(DQ ($ VSub_DollarName '$remote_mode'))}) ] ) ] action: [ (C {(echo)} {(DQ ("Deleted merge conflict for '") ($ VSub_DollarName '$MERGED') ("':"))} ) (C {(describe_file)} {(DQ ($ VSub_DollarName '$local_mode'))} {(DQ (local))} {(DQ ($ VSub_DollarName '$LOCAL'))} ) (C {(describe_file)} {(DQ ($ VSub_DollarName '$remote_mode'))} {(DQ (remote))} {(DQ ($ VSub_DollarName '$REMOTE'))} ) (C {(resolve_deleted_merge)}) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:status) op: Equal rhs: {($ VSub_QMark '$?')} ) ] ) (command.Simple words: [ {(rmdir)} {(-p)} { (DQ (command_sub left_token: <Left_DollarParen '$('> command_list: (command.CommandList children: [(C {(dirname)} {(DQ ($ VSub_DollarName '$MERGED'))})] ) ) ) } ] redirects: [(redir.Redir op:<Redir_Great '2>'> fd:2 arg_word:{(/dev/null)})] ) (command.ControlFlow token: <ControlFlow_Return return> arg_word: {($ VSub_DollarName '$status')} ) ] ) ] ) (command.If arms: [ (if_arm cond: [ (command.AndOr ops: [Op_DPipe] children: [ (C {(is_symlink)} {(DQ ($ VSub_DollarName '$local_mode'))}) (C {(is_symlink)} {(DQ ($ VSub_DollarName '$remote_mode'))}) ] ) ] action: [ (C {(echo)} { (DQ ("Symbolic link merge conflict for '") ($ VSub_DollarName '$MERGED') ("':")) } ) (C {(describe_file)} {(DQ ($ VSub_DollarName '$local_mode'))} {(DQ (local))} {(DQ ($ VSub_DollarName '$LOCAL'))} ) (C {(describe_file)} {(DQ ($ VSub_DollarName '$remote_mode'))} {(DQ (remote))} {(DQ ($ VSub_DollarName '$REMOTE'))} ) (C {(resolve_symlink_merge)}) (command.ControlFlow token:<ControlFlow_Return return>) ] ) ] ) (C {(echo)} {(DQ ("Normal merge conflict for '") ($ VSub_DollarName '$MERGED') ("':"))}) (C {(describe_file)} {(DQ ($ VSub_DollarName '$local_mode'))} {(DQ (local))} {(DQ ($ VSub_DollarName '$LOCAL'))} ) (C {(describe_file)} {(DQ ($ VSub_DollarName '$remote_mode'))} {(DQ (remote))} {(DQ ($ VSub_DollarName '$REMOTE'))} ) (command.If arms: [ (if_arm cond: [ (command.AndOr ops: [Op_DPipe] children: [ (C {(test)} {(DQ ($ VSub_DollarName '$guessed_merge_tool'))} {(Lit_Equals '=')} {(true)} ) (C {(test)} {(DQ ($ VSub_DollarName '$prompt'))} {(Lit_Equals '=')} {(true)}) ] ) ] action: [ (C {(printf)} {(DQ ('Hit return to start merge resolution tool (%s): '))} {(DQ ($ VSub_DollarName '$merge_tool'))} ) (command.AndOr ops: [Op_DPipe] children: [ (C {(read)} {(ans)}) (command.ControlFlow token: <ControlFlow_Return return> arg_word: {(1)} ) ] ) ] ) ] ) (command.If arms: [ (if_arm cond: [(C {(base_present)})] action: [ (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:present) op:Equal rhs:{(true)})] ) ] ) ] else_action: [ (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:present) op:Equal rhs:{(false)})] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Pipeline children: [ (C {(run_merge_tool)} {(DQ ($ VSub_DollarName '$merge_tool'))} {(DQ ($ VSub_DollarName '$present'))} ) ] negated: T ) ] action: [ (command.Simple words: [{(echo)} {(DQ ('merge of ') ($ VSub_DollarName '$MERGED') (' failed'))}] redirects: [(redir.Redir op:<Redir_GreatAnd '1>&'> fd:1 arg_word:{(2)})] ) (C {(mv)} {(--)} {(DQ ($ VSub_DollarName '$BACKUP'))} {(DQ ($ VSub_DollarName '$MERGED'))} ) (command.If arms: [ (if_arm cond: [ (C {(test)} {(DQ ($ VSub_DollarName '$merge_keep_temporaries'))} {(Lit_Equals '=')} {(DQ (false))} ) ] action: [(C {(cleanup_temp_files)})] ) ] ) (command.ControlFlow token: <ControlFlow_Return return> arg_word: {(1)} ) ] ) ] ) (command.If arms: [ (if_arm cond: [ (C {(test)} {(DQ ($ VSub_DollarName '$merge_keep_backup'))} {(Lit_Equals '=')} {(DQ (true))} ) ] action: [ (C {(mv)} {(--)} {(DQ ($ VSub_DollarName '$BACKUP'))} {(DQ ($ VSub_DollarName '$MERGED') (.orig))} ) ] ) ] else_action: [(C {(rm)} {(--)} {(DQ ($ VSub_DollarName '$BACKUP'))})] ) (C {(git)} {(add)} {(--)} {(DQ ($ VSub_DollarName '$MERGED'))}) (C {(cleanup_temp_files)}) (command.ControlFlow token:<ControlFlow_Return return> arg_word:{(0)}) ] ) ) (command.ShFunction name: prompt_after_failed_merge body: (command.BraceGroup children: [ (command.WhileUntil keyword: <KW_While while> cond: [(C {(true)})] body: (command.DoGroup children: [ (C {(printf)} {(DQ ('Continue merging other unresolved paths [y/n]? '))}) (command.AndOr ops: [Op_DPipe] children: [ (C {(read)} {(ans)}) (command.ControlFlow token: <ControlFlow_Return return> arg_word: {(1)} ) ] ) (command.Case to_match: {(DQ ($ VSub_DollarName '$ans'))} arms: [ (case_arm pat_list: [{(Lit_LBracket '[') (yY) (Lit_RBracket ']') (Lit_Star '*')}] action: [ (command.ControlFlow token: <ControlFlow_Return return> arg_word: {(0)} ) ] ) (case_arm pat_list: [{(Lit_LBracket '[') (nN) (Lit_RBracket ']') (Lit_Star '*')}] action: [ (command.ControlFlow token: <ControlFlow_Return return> arg_word: {(1)} ) ] ) ] ) ] ) ) ] ) ) (command.ShFunction name: print_noop_and_exit body: (command.BraceGroup children: [ (C {(echo)} {(DQ ('No files need merging'))}) (command.ControlFlow token:<ControlFlow_Exit exit> arg_word:{(0)}) ] ) ) (command.ShFunction name: main body: (command.BraceGroup children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:prompt) op: Equal rhs: { (command_sub left_token: <Left_DollarParen '$('> command_list: (command.CommandList children: [(C {(git)} {(config)} {(--bool)} {(mergetool.prompt)})] ) ) } ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:guessed_merge_tool) op: Equal rhs: {(false)} ) ] ) (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:orderfile) op:Equal rhs:(word.Empty))] ) (command.WhileUntil keyword: <KW_While while> cond: [(C {(test)} {($ VSub_Pound '$#')} {(KW_Bang '!') (Lit_Equals '=')} {(0)})] body: (command.DoGroup children: [ (command.Case to_match: {(DQ ($ VSub_Number '$1'))} arms: [ (case_arm pat_list: [{(--tool-help) (Lit_Equals '=') (Lit_Star '*')}] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:TOOL_MODE) op: Equal rhs: { (braced_var_sub token: <VSub_Number 1> suffix_op: (suffix_op.Unary op_id: VOp1_Pound arg_word: {('--tool-help=')} ) ) } ) ] ) (C {(show_tool_help)}) ] ) (case_arm pat_list: [{(--tool-help)}] action: [(C {(show_tool_help)})] ) (case_arm pat_list: [{(-t)} {(--tool) (Lit_Star '*')}] action: [ (command.Case to_match: {(DQ ($ VSub_Pound '$#') (',') ($ VSub_Number '$1'))} arms: [ (case_arm pat_list: [ {(Lit_Star '*') (Lit_Comma ',') (Lit_Star '*') (Lit_Equals '=') (Lit_Star '*') } ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:merge_tool) op: Equal rhs: { (command_sub left_token: <Left_DollarParen '$('> command_list: (command.CommandList children: [ (C {(expr)} {(DQ (z) ($ VSub_Number '$1'))} {(Lit_Other ':')} {(SQ <'z-[^=]*=\\(.*\\)'>)} ) ] ) ) } ) ] ) ] ) (case_arm pat_list: [{(1) (Lit_Comma ',') (Lit_Star '*')}] action: [(C {(usage)})] ) (case_arm pat_list: [{(Lit_Star '*')}] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:merge_tool) op: Equal rhs: {(DQ ($ VSub_Number '$2'))} ) ] ) (C {(shift)}) ] ) ] ) ] ) (case_arm pat_list: [{(-y)} {(--no-prompt)}] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:prompt) op: Equal rhs: {(false)} ) ] ) ] ) (case_arm pat_list: [{(--prompt)}] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:prompt) op: Equal rhs: {(true)} ) ] ) ] ) (case_arm pat_list: [{(-O) (Lit_Star '*')}] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:orderfile) op: Equal rhs: {(DQ ($ VSub_Number '$1'))} ) ] ) ] ) (case_arm pat_list: [{(--)}] action: [(C {(shift)}) (command.ControlFlow token:<ControlFlow_Break break>)] ) (case_arm pat_list: [{(-) (Lit_Star '*')}] action: [(C {(usage)})] ) (case_arm pat_list: [{(Lit_Star '*')}] action: [(command.ControlFlow token:<ControlFlow_Break break>)] ) ] ) (C {(shift)}) ] ) ) (C {(git_dir_init)}) (C {(require_work_tree)}) (command.If arms: [ (if_arm cond: [(C {(test)} {(-z)} {(DQ ($ VSub_DollarName '$merge_tool'))})] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:merge_tool) op: Equal rhs: { (command_sub left_token: <Left_DollarParen '$('> command_list: (command.CommandList children: [(C {(get_configured_merge_tool)})] ) ) } ) ] ) (command.If arms: [ (if_arm cond: [(C {(test)} {(-z)} {(DQ ($ VSub_DollarName '$merge_tool'))})] action: [ (command.AndOr ops: [Op_DPipe] children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:merge_tool) op: Equal rhs: { (command_sub left_token: <Left_DollarParen '$('> command_list: (command.CommandList children: [(C {(guess_merge_tool)})] ) ) } ) ] ) (command.ControlFlow token: <ControlFlow_Exit exit> ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:guessed_merge_tool) op: Equal rhs: {(true)} ) ] ) ] ) ] ) ] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:merge_keep_backup) op: Equal rhs: { (DQ (command_sub left_token: <Left_DollarParen '$('> command_list: (command.CommandList children: [ (command.AndOr ops: [Op_DPipe] children: [ (C {(git)} {(config)} {(--bool)} {(mergetool.keepBackup)}) (C {(echo)} {(true)}) ] ) ] ) ) ) } ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:merge_keep_temporaries) op: Equal rhs: { (DQ (command_sub left_token: <Left_DollarParen '$('> command_list: (command.CommandList children: [ (command.AndOr ops: [Op_DPipe] children: [ (C {(git)} {(config)} {(--bool)} {(mergetool.keepTemporaries)}) (C {(echo)} {(false)}) ] ) ] ) ) ) } ) ] ) (command.If arms: [ (if_arm cond: [ (command.AndOr ops: [Op_DAmp] children: [ (C {(test)} {($ VSub_Pound '$#')} {(-eq)} {(0)}) (C {(test)} {(-e)} {(DQ ($ VSub_DollarName '$GIT_DIR') (/MERGE_RR))}) ] ) ] action: [ (C {(KW_Set set)} {(--)} { (command_sub left_token: <Left_DollarParen '$('> command_list: (command.CommandList children: [(C {(git)} {(rerere)} {(remaining)})] ) ) } ) (command.If arms: [ (if_arm cond: [(C {(test)} {($ VSub_Pound '$#')} {(-eq)} {(0)})] action: [(C {(print_noop_and_exit)})] ) ] ) ] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:files) op: Equal rhs: { (command_sub left_token: <Left_DollarParen '$('> command_list: (command.CommandList children: [ (C {(git)} {(-c)} {(core.quotePath) (Lit_Equals '=') (false)} {(diff)} {(--name-only)} {(--diff-filter) (Lit_Equals '=') (U)} { (braced_var_sub token: <VSub_Name orderfile> suffix_op: (suffix_op.Unary op_id: VTest_ColonPlus arg_word: {(DQ ($ VSub_DollarName '$orderfile'))} ) ) } {(--)} {(DQ ($ VSub_At '$@'))} ) ] ) ) } ) ] ) (C {(cd_to_toplevel)}) (command.If arms: [ (if_arm cond: [(C {(test)} {(-z)} {(DQ ($ VSub_DollarName '$files'))})] action: [(C {(print_noop_and_exit)})] ) ] ) (C {(printf)} {(DQ ('Merging:') (Lit_Other '\\') (n))}) (C {(printf)} {(DQ ('%s') (Lit_Other '\\') (n))} {(DQ ($ VSub_DollarName '$files'))}) (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:rc) op:Equal rhs:{(0)})] ) (command.ForEach iter_name: i iter_words: [{($ VSub_DollarName '$files')}] do_arg_iter: F body: (command.DoGroup children: [ (C {(printf)} {(DQ (Lit_Other '\\') (n))}) (command.If arms: [ (if_arm cond: [ (command.Pipeline children: [(C {(merge_file)} {(DQ ($ VSub_DollarName '$i'))})] negated: T ) ] action: [ (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:rc) op:Equal rhs:{(1)})] ) (command.AndOr ops: [Op_DPipe] children: [ (C {(prompt_after_failed_merge)}) (command.ControlFlow token: <ControlFlow_Exit exit> arg_word: {(1)} ) ] ) ] ) ] ) ] ) ) (command.ControlFlow token: <ControlFlow_Exit exit> arg_word: {($ VSub_DollarName '$rc')} ) ] ) ) (C {(main)} {(DQ ($ VSub_At '$@'))}) ] )