Skip to content

Commit d63232a

Browse files
committed
built-in rebase: demonstrate regression with --autostash
An unnamed colleague of Ævar Arnfjörð Bjarmason reported a breakage where a `pull --rebase` (which did not really need to do anything but stash, see that nothing was changed, and apply the stash again) also detached the HEAD. This patch adds a minimal reproducer for this regression. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
1 parent b1811ac commit d63232a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

t/t3420-rebase-autostash.sh

+8
Original file line numberDiff line numberDiff line change
@@ -361,4 +361,12 @@ test_expect_success 'autostash with dirty submodules' '
361361
git rebase -i --autostash HEAD
362362
'
363363

364+
test_expect_failure 'branch is left alone when possible' '
365+
git checkout -b unchanged-branch &&
366+
echo changed >file0 &&
367+
git rebase --autostash unchanged-branch &&
368+
test changed = "$(cat file0)" &&
369+
test unchanged-branch = "$(git rev-parse --abbrev-ref HEAD)"
370+
'
371+
364372
test_done

0 commit comments

Comments
 (0)