summaryrefslogtreecommitdiff
path: root/t/t5573-pull-verify-signatures.sh
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2018-11-06 02:52:13 -0500
committerJunio C Hamano <gitster@pobox.com>2018-11-07 10:11:09 +0900
commit01a31f3bcaae8b62e5e11ee12d7b1606700f0721 (patch)
treea85874bfd7ce641ba26ef75357723afda0f0e83f /t/t5573-pull-verify-signatures.sh
parent7488ba3eeaaaeb8c0e06cca12384f9f7f76082b5 (diff)
downloadgit-01a31f3bcaae8b62e5e11ee12d7b1606700f0721.tar.gz
pull: handle --verify-signatures for unborn branch
We usually just forward the --verify-signatures option along to git-merge, and trust it to do the right thing. However, when we are on an unborn branch (i.e., there is no HEAD yet), we handle this case ourselves without even calling git-merge. And in this code path, we do not respect the verification option at all. It may be more maintainable in the long run to call git-merge for the unborn case. That would fix this bug, as well as prevent similar ones in the future. But unfortunately it's not easy to do. As t5520.3 demonstrates, there are some special cases that git-merge does not handle, like "git pull .. master:master" (by the time git-merge is invoked, we've overwritten the unborn HEAD). So for now let's just teach git-pull to handle this feature. Reported-by: Felix Eckhofer <felix@eckhofer.com> Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5573-pull-verify-signatures.sh')
-rwxr-xr-xt/t5573-pull-verify-signatures.sh7
1 files changed, 7 insertions, 0 deletions
diff --git a/t/t5573-pull-verify-signatures.sh b/t/t5573-pull-verify-signatures.sh
index 747775c147..3e9876e197 100755
--- a/t/t5573-pull-verify-signatures.sh
+++ b/t/t5573-pull-verify-signatures.sh
@@ -78,4 +78,11 @@ test_expect_success GPG 'pull commit with bad signature with --no-verify-signatu
git pull --ff-only --no-verify-signatures bad 2>pullerror
'
+test_expect_success GPG 'pull unsigned commit into unborn branch' '
+ git init empty-repo &&
+ test_must_fail \
+ git -C empty-repo pull --verify-signatures .. 2>pullerror &&
+ test_i18ngrep "does not have a GPG signature" pullerror
+'
+
test_done