Merge branch 'master' of https://github.com/vnwildman/git
[gitweb.git] / t / t5573-pull-verify-signatures.sh
index 9594e891f45d4c0d29b73190c1b5345b4c4d54b6..3e9876e1971348daad7fd87f8aa107ea5fd6aaff 100755 (executable)
@@ -29,7 +29,7 @@ test_expect_success GPG 'create repositories with signed commits' '
                echo 4 >d && git add d &&
                test_tick && git commit -S -m "bad" &&
                git cat-file commit HEAD >raw &&
-               sed -e "s/bad/forged bad/" raw >forged &&
+               sed -e "s/^bad/forged bad/" raw >forged &&
                git hash-object -w -t commit forged >forged.commit &&
                git checkout $(cat forged.commit)
        ) &&
@@ -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