Fourth batch
[gitweb.git] / t / t4055-diff-context.sh
index 35276868ea7de16fdc0818b90bed22a9640aa891..741e0803c1ac0a418c98c7eee9cb449a7c60da06 100755 (executable)
@@ -8,7 +8,7 @@ test_description='diff.context configuration'
 . ./test-lib.sh
 
 test_expect_success 'setup' '
-       cat >x <<-\EOF &&
+       cat >template <<-\EOF &&
        firstline
        b
        c
@@ -16,6 +16,7 @@ test_expect_success 'setup' '
        e
        f
        preline
+       TARGET
        postline
        i
        j
@@ -24,17 +25,15 @@ test_expect_success 'setup' '
        m
        n
        EOF
+       sed "/TARGET/d" >x <template &&
        git update-index --add x &&
        git commit -m initial &&
 
-       git cat-file blob HEAD:x |
-       sed "/preline/a\
-       ADDED" >x &&
+       sed "s/TARGET/ADDED/" >x <template &&
        git update-index --add x &&
        git commit -m next &&
 
-       git cat-file blob HEAD:x |
-       sed s/ADDED/MODIFIED/ >x
+       sed "s/TARGET/MODIFIED/" >x <template
 '
 
 test_expect_success 'the default number of context lines is 3' '
@@ -74,13 +73,13 @@ test_expect_success 'plumbing not affected' '
 test_expect_success 'non-integer config parsing' '
        git config diff.context no &&
        test_must_fail git diff 2>output &&
-       test_i18ngrep "bad config value" output
+       test_i18ngrep "bad numeric config value" output
 '
 
 test_expect_success 'negative integer config parsing' '
        git config diff.context -1 &&
        test_must_fail git diff 2>output &&
-       test_i18ngrep "bad config file" output
+       test_i18ngrep "bad config variable" output
 '
 
 test_expect_success '-U0 is valid, so is diff.context=0' '