From: Mehul Jain Date: Fri, 24 Jun 2016 14:12:34 +0000 (+0530) Subject: t4202: refactor test X-Git-Tag: v2.10.0-rc0~135^2~2 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/aefc81ad38b3a6fc88a0e8db6fafe75692f0d4b3?ds=inline;hp=49fa3dc76179e04b0833542fa52d0f287a4955ac 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 Signed-off-by: Junio C Hamano --- diff --git a/t/t4202-log.sh b/t/t4202-log.sh index 128ba93537..b3d618c43d 100755 --- a/t/t4202-log.sh +++ b/t/t4202-log.sh @@ -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