Merge branch 'dl/honor-cflags-in-hdr-check'
[git.git] / t / t3429-rebase-edit-todo.sh
blob76f6d306eaf39e9727bfeb3dbb04aa3c3941cf1d
1 #!/bin/sh
3 test_description='rebase should reread the todo file if an exec modifies it'
5 . ./test-lib.sh
7 test_expect_success 'rebase exec modifies rebase-todo' '
8 test_commit initial &&
9 todo=.git/rebase-merge/git-rebase-todo &&
10 git rebase HEAD -x "echo exec touch F >>$todo" &&
11 test -e F
14 test_expect_success SHA1 'loose object cache vs re-reading todo list' '
15 GIT_REBASE_TODO=.git/rebase-merge/git-rebase-todo &&
16 export GIT_REBASE_TODO &&
17 write_script append-todo.sh <<-\EOS &&
18 # For values 5 and 6, this yields SHA-1s with the same first two digits
19 echo "pick $(git rev-parse --short \
20 $(printf "%s\\n" \
21 "tree $EMPTY_TREE" \
22 "author A U Thor <author@example.org> $1 +0000" \
23 "committer A U Thor <author@example.org> $1 +0000" \
24 "" \
25 "$1" |
26 git hash-object -t commit -w --stdin))" >>$GIT_REBASE_TODO
28 shift
29 test -z "$*" ||
30 echo "exec $0 $*" >>$GIT_REBASE_TODO
31 EOS
33 git rebase HEAD -x "./append-todo.sh 5 6"
36 test_done