]> git.ipfire.org Git - thirdparty/git.git/commitdiff
rebase --autostash: demonstrate a problem with dirty submodules
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Tue, 23 Oct 2018 19:57:16 +0000 (12:57 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 24 Oct 2018 04:38:13 +0000 (13:38 +0900)
It has been reported that dirty submodules cause problems with the
built-in rebase when it is asked to autostash. The symptom is:

fatal: Unexpected stash response: ''

This patch adds a regression test that demonstrates that bug.

Original report: https://github.com/git-for-windows/git/issues/1820

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t3420-rebase-autostash.sh

index e24370066012fcb441aa0c59ff9c0c34e1d37e9c..b6e18566b5609e82eb954d156eed21076f475bdf 100755 (executable)
@@ -351,4 +351,14 @@ test_expect_success 'autostash is saved on editor failure with conflict' '
        test_cmp expected file0
 '
 
+test_expect_failure 'autostash with dirty submodules' '
+       test_when_finished "git reset --hard && git checkout master" &&
+       git checkout -b with-submodule &&
+       git submodule add ./ sub &&
+       test_tick &&
+       git commit -m add-submodule &&
+       echo changed >sub/file0 &&
+       git rebase -i --autostash HEAD
+'
+
 test_done