(command.CommandList children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:test_description spids:[21]) op: Equal rhs: {(SQ <'Test the post-merge hook.'>)} spids: [21] ) ] spids: [21] ) (C {(.)} {(./test-lib.sh)}) (C {(test_expect_success)} {(setup)} { (SQ <'\n'> <'\techo Data for commit0. >a &&\n'> <'\tgit update-index --add a &&\n'> <'\ttree0=$(git write-tree) &&\n'> <'\tcommit0=$(echo setup | git commit-tree $tree0) &&\n'> <'\techo Changed data for commit1. >a &&\n'> <'\tgit update-index a &&\n'> <'\ttree1=$(git write-tree) &&\n'> <'\tcommit1=$(echo modify | git commit-tree $tree1 -p $commit0) &&\n'> <' git update-ref refs/heads/master $commit0 &&\n'> <'\tgit clone ./. clone1 &&\n'> <'\tGIT_DIR=clone1/.git git update-index --add a &&\n'> <'\tgit clone ./. clone2 &&\n'> <'\tGIT_DIR=clone2/.git git update-index --add a\n'> ) } ) (command.ForEach iter_name: clone iter_words: [{(1)} {(2)}] do_arg_iter: F body: (command.DoGroup children: [ (command.SimpleCommand words: [{(cat)}] redirects: [ (redir.Redir op: <Redir_Great '>'> fd: 16777215 arg_word: {(clone) (${ VSub_Name clone) (/.git/hooks/post-merge)} ) (redir.HereDoc op: <Redir_DLess '<<'> fd: 16777215 here_begin: {(SQ <EOF>)} here_end_span_id: 83 stdin_parts: [('#!/bin/sh\n') ('echo $@ >> $GIT_DIR/post-merge.args\n')] ) ] ) (C {(chmod)} {(u) (Lit_Other '+') (x)} {(clone) (${ VSub_Name clone) (/.git/hooks/post-merge)} ) ] spids: [64 97] ) spids: [58 62] ) (C {(test_expect_success)} {(SQ <'post-merge does not run for up-to-date '>)} { (SQ <'\n'> <' GIT_DIR=clone1/.git git merge $commit0 &&\n'> <'\t! test -f clone1/.git/post-merge.args\n'> ) } ) (C {(test_expect_success)} {(SQ <'post-merge runs as expected '>)} { (SQ <'\n'> <' GIT_DIR=clone1/.git git merge $commit1 &&\n'> <'\ttest -e clone1/.git/post-merge.args\n'> ) } ) (C {(test_expect_success)} {(SQ <'post-merge from normal merge receives the right argument '>)} {(SQ <'\n'> <' grep 0 clone1/.git/post-merge.args\n'>)} ) (C {(test_expect_success)} {(SQ <'post-merge from squash merge runs as expected '>)} { (SQ <'\n'> <' GIT_DIR=clone2/.git git merge --squash $commit1 &&\n'> <'\ttest -e clone2/.git/post-merge.args\n'> ) } ) (C {(test_expect_success)} {(SQ <'post-merge from squash merge receives the right argument '>)} {(SQ <'\n'> <' grep 1 clone2/.git/post-merge.args\n'>)} ) (C {(test_done)}) ] )