[v4,3/4] git-credential-store: fix (WIP)
diff mbox series

Message ID 20200428105254.28658-3-carenas@gmail.com
State New
Headers show
Series
  • credential-store: prevent fatal errors
Related show

Commit Message

Carlo Marcelo Arenas Belón April 28, 2020, 10:52 a.m. UTC
From: Jonathan Nieder <jrnieder@gmail.com>

Helped-by: Carlo Marcelo Arenas Belon <carenas@gmail.com>
---
 credential-store.c          | 4 ++--
 t/t0302-credential-store.sh | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

Comments

Eric Sunshine April 28, 2020, 4:11 p.m. UTC | #1
On Tue, Apr 28, 2020 at 6:53 AM Carlo Marcelo Arenas Belón
<carenas@gmail.com> wrote:
> From: Jonathan Nieder <jrnieder@gmail.com>
> Subject: git-credential-store: fix (WIP)

Um, what? Did you forget to squash this into the previous patch?

> Helped-by: Carlo Marcelo Arenas Belon <carenas@gmail.com>

No sign-off? (Jonathan's)
Carlo Marcelo Arenas Belón April 28, 2020, 5:14 p.m. UTC | #2
On Tue, Apr 28, 2020 at 12:11:20PM -0400, Eric Sunshine wrote:
> On Tue, Apr 28, 2020 at 6:53 AM Carlo Marcelo Arenas Belón
> <carenas@gmail.com> wrote:
> > From: Jonathan Nieder <jrnieder@gmail.com>
> > Subject: git-credential-store: fix (WIP)
> 
> Um, what? Did you forget to squash this into the previous patch?

no; was documenting his proposal from 20200428052510.GA201501@google.com[1]
with the hope (unsuccesfully) to save everyone time and easy testing by
having a series ready to apply.

> > Helped-by: Carlo Marcelo Arenas Belon <carenas@gmail.com>
> 
> No sign-off? (Jonathan's)

really my fault, but was expected as documented in:

  https://lore.kernel.org/git/20200428112518.GA15981@Carlos-MBP/

sorry for the confussion and thanks for your review

Carlo

[1] https://lore.kernel.org/git/20200428052510.GA201501@google.com/

Patch
diff mbox series

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@example.com >"$HOME/.git-credentials" &&
 	check fill store <<-\EOF