Skip to content

Commit

Permalink
reset --stdin: trim carriage return from the paths
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Kevin Willford authored and vdye committed Jul 19, 2023
1 parent 4a1821d commit b7d4bc6
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions t/t7108-reset-stdin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit b7d4bc6

Please sign in to comment.