diff options
author | Junio C Hamano <gitster@pobox.com> | 2012-04-23 12:39:04 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-04-23 12:39:05 -0700 |
commit | 1f643446598c3727b506a46d88f734b13e90dc77 (patch) | |
tree | 7dcbb73fe11b182209a398e56cf02469f7af7db1 | |
parent | d1ca788fcd34962a65924843ef1d0c773d565030 (diff) | |
parent | a6754cda4362d129738d42d2683d07d433379e99 (diff) | |
download | git-1f643446598c3727b506a46d88f734b13e90dc77.tar.gz |
Merge branch 'jk/rebase-i-submodule-conflict-only'
Giving "--continue" to a conflicted "rebase -i" session skipped a commit
that only results in changes to submodules.
By John Keeping
* jk/rebase-i-submodule-conflict-only:
rebase -i continue: don't skip commits that only change submodules
-rw-r--r-- | git-rebase--interactive.sh | 2 | ||||
-rwxr-xr-x | t/t3404-rebase-interactive.sh | 30 |
2 files changed, 31 insertions, 1 deletions
diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh index 2b7eb6dda4..2e1325824c 100644 --- a/git-rebase--interactive.sh +++ b/git-rebase--interactive.sh @@ -672,7 +672,7 @@ rearrange_squash () { case "$action" in continue) # do we have anything to commit? - if git diff-index --cached --quiet --ignore-submodules HEAD -- + if git diff-index --cached --quiet HEAD -- then : Nothing to commit -- skip this else diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh index b981572d73..7fd2127625 100755 --- a/t/t3404-rebase-interactive.sh +++ b/t/t3404-rebase-interactive.sh @@ -624,8 +624,38 @@ test_expect_success 'submodule rebase -i' ' FAKE_LINES="1 squash 2 3" git rebase -i A ' +test_expect_success 'submodule conflict setup' ' + git tag submodule-base && + git checkout HEAD^ && + ( + cd sub && git checkout HEAD^ && echo 4 >elif && + git add elif && git commit -m "submodule conflict" + ) && + git add sub && + test_tick && + git commit -m "Conflict in submodule" && + git tag submodule-topic +' + +test_expect_success 'rebase -i continue with only submodule staged' ' + test_must_fail git rebase -i submodule-base && + git add sub && + git rebase --continue && + test $(git rev-parse submodule-base) != $(git rev-parse HEAD) +' + +test_expect_success 'rebase -i continue with unstaged submodule' ' + git checkout submodule-topic && + git reset --hard && + test_must_fail git rebase -i submodule-base && + git reset && + git rebase --continue && + test $(git rev-parse submodule-base) = $(git rev-parse HEAD) +' + test_expect_success 'avoid unnecessary reset' ' git checkout master && + git reset --hard && test-chmtime =123456789 file3 && git update-index --refresh && HEAD=$(git rev-parse HEAD) && |