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 dscho committed Nov 3, 2023
1 parent 2f819d1 commit a7e5b1d
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 a7e5b1d

Please sign in to comment.