aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2025-08-04 08:10:34 -0700
committerJunio C Hamano <gitster@pobox.com>2025-08-04 08:10:34 -0700
commitea58adaeb9687dd2ed7b9f3a7b309ebe954c6576 (patch)
treebe3a7ac745c80fded142b4b7cd57f2a227d17742
parentMerge branch 'ps/meson-clar-decls-fix' (diff)
parentinteractive: do strip trailing CRLF from input (diff)
downloadgit-ea58adaeb9687dd2ed7b9f3a7b309ebe954c6576.tar.gz
git-ea58adaeb9687dd2ed7b9f3a7b309ebe954c6576.zip
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
-rw-r--r--prompt.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/prompt.c b/prompt.c
index f21c5bf1c7..706fba2a50 100644
--- a/prompt.c
+++ b/prompt.c
@@ -77,12 +77,6 @@ char *git_prompt(const char *prompt, int flags)
int git_read_line_interactively(struct strbuf *line)
{
- int ret;
-
fflush(stdout);
- ret = strbuf_getline_lf(line, stdin);
- if (ret != EOF)
- strbuf_trim_trailing_newline(line);
-
- return ret;
+ return strbuf_getline(line, stdin);
}