. ./test-lib.sh
test_expect_success 'setup' '
- cat >x <<-\EOF &&
+ cat >template <<-\EOF &&
firstline
b
c
e
f
preline
+ TARGET
postline
i
j
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' '