diff --git a/builtin/credential-store.c b/builtin/credential-store.c index bc1453c6b2b1b2..96bd65ea70e7ac 100644 --- a/builtin/credential-store.c +++ b/builtin/credential-store.c @@ -30,7 +30,7 @@ static int parse_credential_file(const char *fn, return found_credential; } - while (strbuf_getline_lf(&line, fh) != EOF) { + while (strbuf_getline(&line, fh) != EOF) { if (!credential_from_url_gently(&entry, line.buf, 1) && entry.username && entry.password && credential_match(c, &entry, match_password)) { diff --git a/t/t0302-credential-store.sh b/t/t0302-credential-store.sh index c1cd60edd019a0..c952c7cbd8f145 100755 --- a/t/t0302-credential-store.sh +++ b/t/t0302-credential-store.sh @@ -143,7 +143,7 @@ invalid_credential_test "scheme" ://user:pass@example.com invalid_credential_test "valid host/path" https://user:pass@ invalid_credential_test "username/password" https://pass@example.com -test_expect_success 'get: credentials with DOS line endings are invalid' ' +test_expect_success 'get: credentials with DOS line endings are valid' ' printf "https://user:pass@example.com\r\n" >"$HOME/.git-credentials" && check fill store <<-\EOF protocol=https @@ -151,11 +151,8 @@ test_expect_success 'get: credentials with DOS line endings are invalid' ' -- protocol=https host=example.com - username=askpass-username - password=askpass-password - -- - askpass: Username for '\''https://example.com'\'': - askpass: Password for '\''https://askpass-username@example.com'\'': + username=user + password=pass -- EOF ' @@ -173,7 +170,7 @@ test_expect_success 'get: credentials with path and DOS line endings are valid' EOF ' -test_expect_success 'get: credentials with DOS line endings are invalid if path is relevant' ' +test_expect_success 'get: credentials with DOS line endings are valid if path is relevant' ' printf "https://user:pass@example.com/repo.git\r\n" >"$HOME/.git-credentials" && test_config credential.useHttpPath true && check fill store <<-\EOF @@ -182,11 +179,8 @@ test_expect_success 'get: credentials with DOS line endings are invalid if path protocol=https host=example.com path=repo.git - username=askpass-username - password=askpass-password - -- - askpass: Username for '\''https://example.com/repo.git'\'': - askpass: Password for '\''https://askpass-username@example.com/repo.git'\'': + username=user + password=pass -- EOF '