Merge branch 'pw/add-p-recount'

"git checkout -p" needs to selectively apply a patch in reverse,
which did not work well.

* pw/add-p-recount:
  add -p: fix checkout -p with pathological context
This commit is contained in:
Junio C Hamano
2019-07-09 15:25:37 -07:00
2 changed files with 13 additions and 1 deletions

View File

@ -639,4 +639,12 @@ test_expect_success 'add -p patch editing works with pathological context lines'
test_cmp expected-2 actual
'
test_expect_success 'checkout -p works with pathological context lines' '
test_write_lines a a a a a a >a &&
git add a &&
test_write_lines a b a b a b a b a b a > a&&
test_write_lines s n n y q | git checkout -p &&
test_write_lines a b a b a a b a b a >expect &&
test_cmp expect a
'
test_done