Skip to content

Commit db29d15

Browse files
nyckyta-tmpGit for Windows Build Agent
authored andcommitted
credential.c: fix credential reading with regards to CR/LF
This fix makes using Git credentials more friendly to Windows users. In previous version it was unable to finish input correctly without configuration changes (tested in PowerShell, CMD, Cygwin). We know credential filling should be finished by empty input, but the current implementation does not take into account CR/LF ending, and hence instead of the empty string we get '\r', which is interpreted as an incorrect string. So this commit changes default reading function to a more Windows compatible reading function. Signed-off-by: Nikita Leonov <[email protected]> Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 6e2bcc8 commit db29d15

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

credential.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ int credential_read(struct credential *c, FILE *fp)
181181
{
182182
struct strbuf line = STRBUF_INIT;
183183

184-
while (strbuf_getline_lf(&line, fp) != EOF) {
184+
while (strbuf_getline(&line, fp) != EOF) {
185185
char *key = line.buf;
186186
char *value = strchr(key, '=');
187187

0 commit comments

Comments
 (0)