Skip to content

Commit

Permalink
rebase --autostash: fix issue with dirty submodules
Browse files Browse the repository at this point in the history
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 git-for-windows#1820

Signed-off-by: Johannes Schindelin <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
  • Loading branch information
dscho committed Nov 15, 2018
1 parent 5a4dc1e commit b1811ac
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion builtin/rebase.c
Original file line number Diff line number Diff line change
Expand Up @@ -1352,7 +1352,7 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
update_index_if_able(&the_index, &lock_file);
rollback_lock_file(&lock_file);

if (has_unstaged_changes(0) || has_uncommitted_changes(0)) {
if (has_unstaged_changes(1) || has_uncommitted_changes(1)) {
const char *autostash =
state_dir_path("autostash", &options);
struct child_process stash = CHILD_PROCESS_INIT;
Expand Down
2 changes: 1 addition & 1 deletion t/t3420-rebase-autostash.sh
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ test_expect_success 'autostash is saved on editor failure with conflict' '
test_cmp expected file0
'

test_expect_failure 'autostash with dirty submodules' '
test_expect_success 'autostash with dirty submodules' '
test_when_finished "git reset --hard && git checkout master" &&
git checkout -b with-submodule &&
git submodule add ./ sub &&
Expand Down

0 comments on commit b1811ac

Please sign in to comment.