Re: [PATCH 1/2] t7505: Add tests for cherry-pick and rebase -i/-p

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jan 19, 2018 at 9:19 AM, Phillip Wood <phillip.wood@xxxxxxxxxxxx> wrote:
> Check that cherry-pick and rebase call the 'prepare-commit-msg' hook
> correctly. [...]
>
> Signed-off-by: Phillip Wood <phillip.wood@xxxxxxxxxxxxx>
> ---
> 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 ...).

> +       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
> +'



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux