mirror of
https://github.com/git/git.git
synced 2024-06-02 07:06:10 +02:00
libsecret: retrieve empty password
Since 0ce02e2f
(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 <mirth.hickford@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
dadef801b3
commit
8f1f2023b7
|
@ -164,6 +164,9 @@ static int keyring_get(struct credential *c)
|
||||||
if (g_strv_length(parts) >= 1) {
|
if (g_strv_length(parts) >= 1) {
|
||||||
g_free(c->password);
|
g_free(c->password);
|
||||||
c->password = g_strdup(parts[0]);
|
c->password = g_strdup(parts[0]);
|
||||||
|
} else {
|
||||||
|
g_free(c->password);
|
||||||
|
c->password = g_strdup("");
|
||||||
}
|
}
|
||||||
for (int i = 1; i < g_strv_length(parts); i++) {
|
for (int i = 1; i < g_strv_length(parts); i++) {
|
||||||
if (g_str_has_prefix(parts[i], "password_expiry_utc=")) {
|
if (g_str_has_prefix(parts[i], "password_expiry_utc=")) {
|
||||||
|
|
Loading…
Reference in New Issue