Re: [PATCH] rebase -i: test "Nothing to do" case with autostash
On Tue, May 20, 2014 at 2:55 AM, Matthieu Moy <Matthieu.Moy@imag.fr> wrote:
Show 27 quoted lines
> Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
> ---
> Ram's patch lacks a test. Here it is. Fails without Ram's patch, and
> passes with it.
>
> Can be squashed into Ram's patch.
>
> t/t3420-rebase-autostash.sh | 17 +++++++++++++++++
> 1 file changed, 17 insertions(+)
>
> diff --git a/t/t3420-rebase-autostash.sh b/t/t3420-rebase-autostash.sh
> index 90eb264..c2e9a4c 100755
> --- a/t/t3420-rebase-autostash.sh
> +++ b/t/t3420-rebase-autostash.sh
> @@ -167,4 +167,21 @@ testrebase "" .git/rebase-apply
> testrebase " --merge" .git/rebase-merge
> testrebase " --interactive" .git/rebase-merge
>
> +test_expect_success 'Abort rebase with --autostash' '
> + git log &&
> + echo new-content >file0 &&
> + (
> + write_script abort-editor.sh <<-\EOF &&
> + echo > "$1"
> + EOF
> + GIT_EDITOR=\"$(pwd)/abort-editor.sh\" &&
> + export GIT_EDITOR &&
Simpler (replace above two lines):
test_set_editor "$(pwd)/abort-editor.sh" &&
Show 11 quoted lines
> + test_must_fail git rebase -i --autostash HEAD^ &&
> + rm -f abort-editor.sh
> + ) &&
> + git status &&
> + echo new-content >expected &&
> + test_cmp expected file0
> +'
> +
> test_done
> --
> 2.0.0.rc3.499.gd6dc9ad