Skip to content

Commit 8f1f202

Browse files
hickfordgitster
authored andcommitted
libsecret: retrieve empty password
Since 0ce02e2 (credential/libsecret: store new attributes, 2023-06-16) a test that stores empty username and password fails when t0303-credential-external.sh is run with GIT_TEST_CREDENTIAL_HELPER=libsecret. Retrieve empty password carefully. This fixes test: ok 14 - helper (libsecret) can store empty username Signed-off-by: M Hickford <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent dadef80 commit 8f1f202

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

contrib/credential/libsecret/git-credential-libsecret.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,9 @@ static int keyring_get(struct credential *c)
164164
if (g_strv_length(parts) >= 1) {
165165
g_free(c->password);
166166
c->password = g_strdup(parts[0]);
167+
} else {
168+
g_free(c->password);
169+
c->password = g_strdup("");
167170
}
168171
for (int i = 1; i < g_strv_length(parts); i++) {
169172
if (g_str_has_prefix(parts[i], "password_expiry_utc=")) {

0 commit comments

Comments
 (0)