1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-10-28 12:59:41 +01:00

Merge branch 'mh/libsecret-empty-password-fix'

Credential helper based on libsecret (in contrib/) has been updated
to handle an empty password correctly.

* mh/libsecret-empty-password-fix:
  libsecret: retrieve empty password
This commit is contained in:
Junio C Hamano 2024-02-27 16:04:32 -08:00
commit 70dadd510b

View file

@ -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=")) {