Git fork

t: use test_config in t4055

Use the modern "test_config" test utility instead of manual"git config"
as the former provides clean up on test completion.

This is a prerequisite to the commits that follow which add to this test
file.

Signed-off-by: Leon Michalak <leonmichalak6@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

authored by

Leon Michalak and committed by
Junio C Hamano
97b99a9e 671b2839

+7 -7
+7 -7
t/t4055-diff-context.sh
··· 47 47 test_expect_success 'diff.context honored by "log"' ' 48 48 git log -1 -p >output && 49 49 test_grep ! firstline output && 50 - git config diff.context 8 && 50 + test_config diff.context 8 && 51 51 git log -1 -p >output && 52 52 test_grep "^ firstline" output 53 53 ' 54 54 55 55 test_expect_success 'The -U option overrides diff.context' ' 56 - git config diff.context 8 && 56 + test_config diff.context 8 && 57 57 git log -U4 -1 >output && 58 58 test_grep ! "^ firstline" output 59 59 ' 60 60 61 61 test_expect_success 'diff.context honored by "diff"' ' 62 - git config diff.context 8 && 62 + test_config diff.context 8 && 63 63 git diff >output && 64 64 test_grep "^ firstline" output 65 65 ' 66 66 67 67 test_expect_success 'plumbing not affected' ' 68 - git config diff.context 8 && 68 + test_config diff.context 8 && 69 69 git diff-files -p >output && 70 70 test_grep ! "^ firstline" output 71 71 ' 72 72 73 73 test_expect_success 'non-integer config parsing' ' 74 - git config diff.context no && 74 + test_config diff.context no && 75 75 test_must_fail git diff 2>output && 76 76 test_grep "bad numeric config value" output 77 77 ' 78 78 79 79 test_expect_success 'negative integer config parsing' ' 80 - git config diff.context -1 && 80 + test_config diff.context -1 && 81 81 test_must_fail git diff 2>output && 82 82 test_grep "bad config variable" output 83 83 ' 84 84 85 85 test_expect_success '-U0 is valid, so is diff.context=0' ' 86 - git config diff.context 0 && 86 + test_config diff.context 0 && 87 87 git diff >output && 88 88 test_grep "^-ADDED" output && 89 89 test_grep "^+MODIFIED" output