summaryrefslogtreecommitdiff
path: root/t/t4151-am-abort.sh
diff options
context:
space:
mode:
authorPaul Tan <pyokagan@gmail.com>2015-06-06 11:46:08 (GMT)
committerJunio C Hamano <gitster@pobox.com>2015-06-08 20:06:09 (GMT)
commit2c970c9ec3af9e162951a1b22d42c1a4dd9a8fed (patch)
tree7031a4f7b6c26e3207a5ee2308096f1e55818f86 /t/t4151-am-abort.sh
parent88d5072466de2e0ba256a283eaaa6a79e31735a5 (diff)
downloadgit-2c970c9ec3af9e162951a1b22d42c1a4dd9a8fed.zip
git-2c970c9ec3af9e162951a1b22d42c1a4dd9a8fed.tar.gz
git-2c970c9ec3af9e162951a1b22d42c1a4dd9a8fed.tar.bz2
am -3: support 3way merge on unborn branch
While on an unborn branch, git am -3 will fail to do a threeway merge as it references HEAD as "our tree", but HEAD does not point to a valid tree. Fix this by using an empty tree as "our tree" when we are on an unborn branch. Signed-off-by: Paul Tan <pyokagan@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4151-am-abort.sh')
-rwxr-xr-xt/t4151-am-abort.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/t/t4151-am-abort.sh b/t/t4151-am-abort.sh
index 5ac741a..2683ffa 100755
--- a/t/t4151-am-abort.sh
+++ b/t/t4151-am-abort.sh
@@ -83,4 +83,13 @@ test_expect_success 'am --abort will keep the local commits intact' '
test_cmp expect actual
'
+test_expect_success 'am -3 stops on conflict on unborn branch' '
+ git checkout -f --orphan orphan &&
+ git reset &&
+ rm -f otherfile-4 &&
+ test_must_fail git am -3 0003-*.patch &&
+ test 2 -eq $(git ls-files -u | wc -l) &&
+ test 4 = "$(cat otherfile-4)"
+'
+
test_done