aboutsummaryrefslogtreecommitdiff
path: root/t/t4150-am.sh
diff options
context:
space:
mode:
authorNanako Shiraishi <nanako3@lavabit.com>2009-04-10 09:34:42 +0900
committerJunio C Hamano <gitster@pobox.com>2009-04-12 18:42:15 -0700
commitf79d4c8a0f22d7fd25018be846c7e48127ed3200 (patch)
tree09d817f4c80a8af43f562b37823767295fe75d05 /t/t4150-am.sh
parentee7ec2f9ded03700f2b95cc1d4b3d60ed374132a (diff)
downloadgit-f79d4c8a0f22d7fd25018be846c7e48127ed3200.tar.gz
git-f79d4c8a0f22d7fd25018be846c7e48127ed3200.tar.xz
git-am: teach git-am to apply a patch to an unborn branch
People sometimes wonder why they cannot apply a patch that only creates new files to an unborn branch. Signed-off-by: Nanako Shiraishi <nanako3@lavabit.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4150-am.sh')
-rwxr-xr-xt/t4150-am.sh15
1 files changed, 15 insertions, 0 deletions
diff --git a/t/t4150-am.sh b/t/t4150-am.sh
index 5e65afa0c..d6ebbaebe 100755
--- a/t/t4150-am.sh
+++ b/t/t4150-am.sh
@@ -290,4 +290,19 @@ test_expect_success 'am --ignore-date' '
echo "$at" | grep "+0000"
'
+test_expect_success 'am into an unborn branch' '
+ rm -fr subdir &&
+ mkdir -p subdir &&
+ git format-patch --numbered-files -o subdir -1 first &&
+ (
+ cd subdir &&
+ git init &&
+ git am 1
+ ) &&
+ result=$(
+ cd subdir && git rev-parse HEAD^{tree}
+ ) &&
+ test "z$result" = "z$(git rev-parse first^{tree})"
+'
+
test_done