Re: [PATCH 1/2] t7505: Add tests for cherry-pick and rebase -i/-p
On Fri, Jan 19, 2018 at 9:19 AM, Phillip Wood <phillip.wood@talktalk.net> wrote:
Show 15 quoted lines
> Check that cherry-pick and rebase call the 'prepare-commit-msg' hook
> correctly. [...]
>
> Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
> ---
> diff --git a/t/t7505-prepare-commit-msg-hook.sh b/t/t7505-prepare-commit-msg-hook.sh
> @@ -4,6 +4,38 @@ test_description='prepare-commit-msg hook'
> +test_expect_success 'set up commits for rebasing' '
> + test_commit root &&
> + test_commit a a a &&
> + test_commit b b b &&
> + git checkout -b rebase-me root &&
> + test_commit rebase-a a aa &&
> + test_commit rebase-b b bb &&
> + for i in $(seq 1 13)
For portability, use $(test_seq ...) rather than $(seq ...).
Show 23 quoted lines
> + do
> + test_commit rebase-$i c $i
> + done &&
> + git checkout master &&
> +
> + cat >rebase-todo <<-EOF
> + pick $(git rev-parse rebase-a)
> + pick $(git rev-parse rebase-b)
> + fixup $(git rev-parse rebase-1)
> + fixup $(git rev-parse rebase-2)
> + pick $(git rev-parse rebase-3)
> + fixup $(git rev-parse rebase-4)
> + squash $(git rev-parse rebase-5)
> + reword $(git rev-parse rebase-6)
> + squash $(git rev-parse rebase-7)
> + fixup $(git rev-parse rebase-8)
> + fixup $(git rev-parse rebase-9)
> + edit $(git rev-parse rebase-10)
> + squash $(git rev-parse rebase-11)
> + squash $(git rev-parse rebase-12)
> + edit $(git rev-parse rebase-13)
> + EOF
> +'