Merge branch 'js/prompt-crlf-fix'

Interactive prompt code did not correctly strip CRLF from the end
of line on Windows.

* js/prompt-crlf-fix:
  interactive: do strip trailing CRLF from input
This commit is contained in:
Junio C Hamano
2025-08-04 08:10:34 -07:00

View File

@@ -77,12 +77,6 @@ char *git_prompt(const char *prompt, int flags)
int git_read_line_interactively(struct strbuf *line) int git_read_line_interactively(struct strbuf *line)
{ {
int ret;
fflush(stdout); fflush(stdout);
ret = strbuf_getline_lf(line, stdin); return strbuf_getline(line, stdin);
if (ret != EOF)
strbuf_trim_trailing_newline(line);
return ret;
} }