Skip to content

Commit 6109cfb

Browse files
Kevin Willforddscho
Kevin Willford
authored andcommitted
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>
1 parent 1f96323 commit 6109cfb

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Diff for: t/t7108-reset-stdin.sh

+9
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,13 @@ test_expect_success '--stdin requires --mixed' '
2929
git reset --mixed --stdin <list
3030
'
3131

32+
33+
test_expect_success '--stdin trims carriage returns' '
34+
test_commit endline &&
35+
git rm endline.t &&
36+
printf "endline.t\r\n" >list &&
37+
git reset --stdin <list &&
38+
test endline.t = "$(git ls-files endline.t)"
39+
'
40+
3241
test_done

0 commit comments

Comments
 (0)