Re: [PATCH] rebase -i: restore autostash on abort

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

 



Patrick Steinhardt <ps@xxxxxx> writes:

> When we abort an interactive rebase we do so by calling
> `die_abort`, which cleans up after us by removing the rebase
> state directory. If the user has requested to use the autostash
> feature, though, the state directory may also contain a reference
> to the autostash, which will now be deleted.
>
> Fix the issue by trying to re-apply the autostash in `die_abort`.
> This will also handle the case where the autostash does not apply
> cleanly anymore by recording it in a user-visible stash.

I do not do autostash myself, but it is a good thing to try not to
lose information ;-)

> +test_expect_success 'restore autostash on editor failure' '
> +	test_when_finished "git reset --hard" &&
> +	echo uncommited-content >file0 &&
> +	(
> +		test_set_editor "false" &&
> +		test_must_fail git rebase -i --autostash HEAD^
> +	) &&
> +	echo uncommited-content >expected &&

While making sure this case works is crucial, it is not an
interesting failure mode, is it?  Can we also have "does not apply
cleanly anymore" case, too?


> +	test_cmp expected file0
> +'
> +
>  test_done
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[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]