aboutsummaryrefslogtreecommitdiff
path: root/t/t3404-rebase-interactive.sh
diff options
context:
space:
mode:
authorJohannes Schindelin <Johannes.Schindelin@gmx.de>2009-03-03 10:55:31 +0100
committerJunio C Hamano <gitster@pobox.com>2009-03-03 10:56:22 -0800
commit0e757e30c726d9d8ae82bd9989be3cff5d230288 (patch)
treeeb1e1a6de6052abbf6523893f0627aaeb1e6610f /t/t3404-rebase-interactive.sh
parent1d035f85649cbb0a4fcc3e341f7e854acf9cf3c1 (diff)
downloadgit-0e757e30c726d9d8ae82bd9989be3cff5d230288.tar.gz
git-0e757e30c726d9d8ae82bd9989be3cff5d230288.tar.xz
rebase -i: avoid 'git reset' when possible
When picking commits whose parents have not changed, we do not need to rewrite the commit. We do not need to reset the working directory to the parent's state, either. Requested by Sverre Rabbelier. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t3404-rebase-interactive.sh')
-rwxr-xr-xt/t3404-rebase-interactive.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh
index 603b003ed..c32ff6682 100755
--- a/t/t3404-rebase-interactive.sh
+++ b/t/t3404-rebase-interactive.sh
@@ -459,4 +459,15 @@ test_expect_success 'submodule rebase -i' '
FAKE_LINES="1 squash 2 3" git rebase -i A
'
+test_expect_success 'avoid unnecessary reset' '
+ git checkout master &&
+ test-chmtime =123456789 file3 &&
+ git update-index --refresh &&
+ HEAD=$(git rev-parse HEAD) &&
+ git rebase -i HEAD~4 &&
+ test $HEAD = $(git rev-parse HEAD) &&
+ MTIME=$(test-chmtime -v +0 file3 | sed 's/[^0-9].*$//') &&
+ test 123456789 = $MTIME
+'
+
test_done