t4202: refactor test
Subsequent patches will want to reuse the 'signed' branch that the 'log --graph --show-signature' test creates and uses. Split the set-up part into a test of its own, and make the existing test into a separate one that only inspects the history on the 'signed' branch. This way, it becomes clearer that tests added by subsequent patches reuse the 'signed' branch in the same way. Signed-off-by: Mehul Jain <mehul.jain2029@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Mehul Jain committed
Jun 24, 2016 at 19:42 UTC
aefc81ad38b3a6fc88a0e8db6fafe75692f0d4b3
1 file changed
+5
-2
t/t4202-log.sh
+5
-2
@@ -860,12 +860,15 @@ test_expect_success 'dotdot is a parent directory' '
860
test_cmp expect actual
861
'
862
863
-test_expect_success GPG 'log --graph --show-signature' '
863
+test_expect_success GPG 'setup signed branch' '
864
test_when_finished "git reset --hard && git checkout master" &&
865
git checkout -b signed master &&
866
echo foo >foo &&
867
git add foo &&
868
- git commit -S -m signed_commit &&
868
+ git commit -S -m signed_commit
869
+'
870
+
871
+test_expect_success GPG 'log --graph --show-signature' '
872
git log --graph --show-signature -n1 signed >actual &&
873
grep "^| gpg: Signature made" actual &&
874
grep "^| gpg: Good signature" actual