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 Aug 11, 2023
1 parent a67b85b commit 80ba2c8
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 80ba2c8

Please sign in to comment.