aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorRamkumar Ramachandra <artagnon@gmail.com>2010-08-28 01:58:16 +0530
committerJunio C Hamano <gitster@pobox.com>2010-08-27 16:47:45 -0700
commit2c642ed8668745271a714f0a672dbfcd6b0a6fa8 (patch)
treefa9ad23593a89c3cd89ec8ebd04535a94acb1345 /t
parent6426f2d2afb42e51dac901ff666c3296424c6f5c (diff)
downloadgit-2c642ed8668745271a714f0a672dbfcd6b0a6fa8.tar.gz
git-2c642ed8668745271a714f0a672dbfcd6b0a6fa8.tar.xz
format-patch: Don't go over merge commits
If the topmost three commits in a branch were merge commits, 'git format-patch -3' used to output nothing. Since Git can't prepare patches out of merge commits anyway, don't go over them in the first place. 'git format-patch -3' now prepares three patches from the topmost three commits without counting merge commits. Also add a corresponding test in t4014-format-patch and update documentation. Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t4014-format-patch.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh
index 6321ac88a..2e78c9e66 100755
--- a/t/t4014-format-patch.sh
+++ b/t/t4014-format-patch.sh
@@ -56,6 +56,22 @@ test_expect_success "format-patch --ignore-if-in-upstream" '
'
+test_expect_success "format-patch doesn't consider merge commits" '
+
+ git checkout -b slave master &&
+ echo "Another line" >>file &&
+ test_tick &&
+ git commit -am "Slave change #1" &&
+ echo "Yet another line" >>file &&
+ test_tick &&
+ git commit -am "Slave change #2" &&
+ git checkout -b merger master &&
+ test_tick &&
+ git merge --no-ff slave &&
+ cnt=`git format-patch -3 --stdout | grep "^From " | wc -l` &&
+ test $cnt = 3
+'
+
test_expect_success "format-patch result applies" '
git checkout -b rebuild-0 master &&