diff options
author | Junio C Hamano <gitster@pobox.com> | 2015-06-01 10:44:21 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-06-01 16:02:52 -0700 |
commit | 9b7a61d7dab1635607b1b5be480ac78944cafb45 (patch) | |
tree | 016ff072c44a56e8b5901b74bf1049372b6f1a69 /t/t4014-format-patch.sh | |
parent | fdf96a20acf96a6ac538df8113b2aafd6ed71d50 (diff) | |
download | git-9b7a61d7dab1635607b1b5be480ac78944cafb45.tar.gz git-9b7a61d7dab1635607b1b5be480ac78944cafb45.tar.xz |
format-patch: do not feed tags to clear_commit_marks()
"git format-patch --ignore-if-in-upstream A..B", when either A or B
is a tag, failed miserably.
This is because the code passes the tips it used for traversal to
clear_commit_marks(), after running a temporary revision traversal
to enumerate the commits on both branches to find if they have
commits that make equivalent changes. The revision traversal
machinery knows how to enumerate commits reachable starting from a
tag, but clear_commit_marks() wants to take nothing but a commit.
In the longer term, it might be a more correct fix to teach
clear_commit_marks() to do the same "committish to commit"
dereferencing that is done in the revision traversal machinery,
but for now this fix should suffice.
Reported-by: Bruce Korb <bruce.korb@gmail.com>
Helped-by: Christian Couder <christian.couder@gmail.com>
Helped-by: brian m. carlson <sandals@crustytoothpaste.net>
Helped-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4014-format-patch.sh')
-rwxr-xr-x | t/t4014-format-patch.sh | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh index 256affce8..2ea12dd08 100755 --- a/t/t4014-format-patch.sh +++ b/t/t4014-format-patch.sh @@ -57,6 +57,14 @@ test_expect_success "format-patch --ignore-if-in-upstream" ' ' +test_expect_success "format-patch --ignore-if-in-upstream handles tags" ' + git tag -a v1 -m tag side && + git tag -a v2 -m tag master && + git format-patch --stdout --ignore-if-in-upstream v2..v1 >patch1 && + cnt=$(grep "^From " patch1 | wc -l) && + test $cnt = 2 +' + test_expect_success "format-patch doesn't consider merge commits" ' git checkout -b slave master && |