From: Jonathan Nieder <jrnieder@xxxxxxxxx> Helped-by: Carlo Marcelo Arenas Belon <carenas@xxxxxxxxx> --- credential-store.c | 4 ++-- t/t0302-credential-store.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/credential-store.c b/credential-store.c index c010497cb2..294e771681 100644 --- a/credential-store.c +++ b/credential-store.c @@ -24,8 +24,8 @@ static int parse_credential_file(const char *fn, } while (strbuf_getline_lf(&line, fh) != EOF) { - credential_from_url(&entry, line.buf); - if (entry.username && entry.password && + if (!credential_from_url_gently(&entry, line.buf, 1) && + entry.username && entry.password && credential_match(c, &entry)) { found_credential = 1; if (match_cb) { diff --git a/t/t0302-credential-store.sh b/t/t0302-credential-store.sh index 94cdcb9e56..4e5a73cb99 100755 --- a/t/t0302-credential-store.sh +++ b/t/t0302-credential-store.sh @@ -120,7 +120,7 @@ test_expect_success 'erase: erase matching credentials from both xdg and home fi test_must_be_empty "$HOME/.config/git/credentials" ' -test_expect_failure 'get: store file can contain empty/bogus lines' ' +test_expect_success 'get: store file can contain empty/bogus lines' ' test_write_lines "#comment" " " "" \ https://user:pass@xxxxxxxxxxx >"$HOME/.git-credentials" && check fill store <<-\EOF -- 2.26.2.569.g1d74ac4d14