Skip to content

Commit 8e97b89

Browse files
committed
rebase --autostash: fix issue with dirty submodules
Since we cannot stash dirty submodules, there is no use in requiring them to be clean (or stash them when they are not). This brings the built-in rebase in line with the previous, scripted version, which also did not care about dirty submodules (but it was admittedly not very easy to figure that out). This fixes #1820 Signed-off-by: Johannes Schindelin <[email protected]> Signed-off-by: Junio C Hamano <[email protected]> Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 503d692 commit 8e97b89

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

builtin/rebase.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1352,7 +1352,7 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
13521352
update_index_if_able(&the_index, &lock_file);
13531353
rollback_lock_file(&lock_file);
13541354

1355-
if (has_unstaged_changes(0) || has_uncommitted_changes(0)) {
1355+
if (has_unstaged_changes(1) || has_uncommitted_changes(1)) {
13561356
const char *autostash =
13571357
state_dir_path("autostash", &options);
13581358
struct child_process stash = CHILD_PROCESS_INIT;

t/t3420-rebase-autostash.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ test_expect_success 'autostash is saved on editor failure with conflict' '
351351
test_cmp expected file0
352352
'
353353

354-
test_expect_failure 'autostash with dirty submodules' '
354+
test_expect_success 'autostash with dirty submodules' '
355355
test_when_finished "git reset --hard && git checkout master" &&
356356
git checkout -b with-submodule &&
357357
git submodule add ./ sub &&

0 commit comments

Comments
 (0)