Skip to content

Commit

Permalink
git add -i: handle CR/LF line endings in the interactive input
Browse files Browse the repository at this point in the history
As of Git for Windows v2.27.0, there is an option to use Windows'
newly-introduced Pseudo Console support. When running an interactive add
operation with this support enabled, Git will receive CR/LF line
endings.

Therefore, let's not pretend that we are expecting Unix line endings.

This fixes #2729

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
  • Loading branch information
dscho authored and Git for Windows Build Agent committed Oct 22, 2024
1 parent 7d88d62 commit d7e0929
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion prompt.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ int git_read_line_interactively(struct strbuf *line)
int ret;

fflush(stdout);
ret = strbuf_getline_lf(line, stdin);
ret = strbuf_getline(line, stdin);
if (ret != EOF)
strbuf_trim_trailing_newline(line);

Expand Down

0 comments on commit d7e0929

Please sign in to comment.