Skip to content

Commit 15ae0ff

Browse files
committed
Merge 'gvfs-preamble' into HEAD
2 parents 2481c4c + a2de79d commit 15ae0ff

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

builtin/reset.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ int cmd_reset(int argc, const char **argv, const char *prefix)
327327

328328
if (read_from_stdin) {
329329
strbuf_getline_fn getline_fn = nul_term_line ?
330-
strbuf_getline_nul : strbuf_getline_lf;
330+
strbuf_getline_nul : strbuf_getline;
331331
int flags = PATHSPEC_PREFER_FULL;
332332
struct strbuf buf = STRBUF_INIT;
333333
struct strbuf unquoted = STRBUF_INIT;

t/t7108-reset-stdin.sh

Lines changed: 9 additions & 0 deletions
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)