reset --stdin: trim carriage return from the paths

While using the reset --stdin feature on windows path added may have a
\r at the end of the path that wasn't getting removed so didn't match
the path in the index and wasn't reset.

Signed-off-by: Kevin Willford <kewillf@microsoft.com>
This commit is contained in:
Kevin Willford 2017-04-05 10:58:09 -06:00 коммит произвёл Johannes Schindelin
Родитель 1d90ca2906
Коммит 25eadf2389
1 изменённых файлов: 9 добавлений и 0 удалений

Просмотреть файл

@ -29,4 +29,13 @@ test_expect_success '--stdin requires --mixed' '
git reset --mixed --stdin <list
'
test_expect_success '--stdin trims carriage returns' '
test_commit endline &&
git rm endline.t &&
printf "endline.t\r\n" >list &&
git reset --stdin <list &&
test endline.t = "$(git ls-files endline.t)"
'
test_done