summaryrefslogtreecommitdiff
path: root/t/t3404-rebase-interactive.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-04-03 12:28:44 -0700
committerJunio C Hamano <gitster@pobox.com>2010-04-03 12:28:44 -0700
commit9234b003726556e0d3d0ea8ade97dc9f7bd50a6e (patch)
tree194e8895d8a2e7c7dba0f5e6ab9108231aaae711 /t/t3404-rebase-interactive.sh
parent7b1cb5c40ebb57c5a26f1335807be24dba8d4518 (diff)
parentb499549401cb2b1f6c30d09681380fd519938eb0 (diff)
downloadgit-9234b003726556e0d3d0ea8ade97dc9f7bd50a6e.tar.gz
Merge branch 'mb/rebase-i-no-ff'
* mb/rebase-i-no-ff: Teach rebase the --no-ff option. Conflicts: git-rebase--interactive.sh t/t3404-rebase-interactive.sh
Diffstat (limited to 't/t3404-rebase-interactive.sh')
-rwxr-xr-xt/t3404-rebase-interactive.sh36
1 files changed, 32 insertions, 4 deletions
diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh
index b0b43c6d32..f20ea38411 100755
--- a/t/t3404-rebase-interactive.sh
+++ b/t/t3404-rebase-interactive.sh
@@ -22,12 +22,18 @@ set_fake_editor
# | \
# | F - G - H (branch1)
# | \
-# \ I (branch2)
-# \
-# J - K - L - M (no-conflict-branch)
+# |\ I (branch2)
+# | \
+# | J - K - L - M (no-conflict-branch)
+# \
+# N - O - P (no-ff-branch)
#
# where A, B, D and G all touch file1, and one, two, three, four all
# touch file "conflict".
+#
+# WARNING: Modifications to the initial repository can change the SHA ID used
+# in the expect2 file for the 'stop on conflicting pick' test.
+
test_expect_success 'setup' '
test_commit A file1 &&
@@ -50,6 +56,11 @@ test_expect_success 'setup' '
for n in J K L M
do
test_commit $n file$n
+ done &&
+ git checkout -b no-ff-branch A &&
+ for n in N O P
+ do
+ test_commit $n file$n
done
'
@@ -113,7 +124,7 @@ cat > expect2 << EOF
D
=======
G
->>>>>>> 51047de... G
+>>>>>>> 5d18e54... G
EOF
test_expect_success 'stop on conflicting pick' '
@@ -586,4 +597,21 @@ test_expect_success 'rebase while detaching HEAD' '
test_must_fail git symbolic-ref HEAD
'
+test_tick # Ensure that the rebased commits get a different timestamp.
+test_expect_success 'always cherry-pick with --no-ff' '
+ git checkout no-ff-branch &&
+ git tag original-no-ff-branch &&
+ git rebase -i --no-ff A &&
+ touch empty &&
+ for p in 0 1 2
+ do
+ test ! $(git rev-parse HEAD~$p) = $(git rev-parse original-no-ff-branch~$p) &&
+ git diff HEAD~$p original-no-ff-branch~$p > out &&
+ test_cmp empty out
+ done &&
+ test $(git rev-parse HEAD~3) = $(git rev-parse original-no-ff-branch~3) &&
+ git diff HEAD~3 original-no-ff-branch~3 > out &&
+ test_cmp empty out
+'
+
test_done