t4202: refactor test
authorMehul Jain <mehul.jain2029@gmail.com>
Fri, 24 Jun 2016 14:12:34 +0000 (19:42 +0530)
committerJunio C Hamano <gitster@pobox.com>
Fri, 24 Jun 2016 20:00:39 +0000 (13:00 -0700)
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>
t/t4202-log.sh
index 128ba935371fe7a35b4fb8b80ba361a086be01f7..b3d618c43da29a8e445181ca8396b694665197a8 100755 (executable)
@@ -860,12 +860,15 @@ test_expect_success 'dotdot is a parent directory' '
        test_cmp expect actual
 '
 
-test_expect_success GPG 'log --graph --show-signature' '
+test_expect_success GPG 'setup signed branch' '
        test_when_finished "git reset --hard && git checkout master" &&
        git checkout -b signed master &&
        echo foo >foo &&
        git add foo &&
-       git commit -S -m signed_commit &&
+       git commit -S -m signed_commit
+'
+
+test_expect_success GPG 'log --graph --show-signature' '
        git log --graph --show-signature -n1 signed >actual &&
        grep "^| gpg: Signature made" actual &&
        grep "^| gpg: Good signature" actual