]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'mh/libsecret-empty-password-fix'
authorJunio C Hamano <gitster@pobox.com>
Wed, 28 Feb 2024 00:04:32 +0000 (16:04 -0800)
committerJunio C Hamano <gitster@pobox.com>
Wed, 28 Feb 2024 00:04:32 +0000 (16:04 -0800)
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

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

index 215a81d8bae59ca2364eb762c72089ff8b6b51d7..90034d0cf1eb3d04c04872f38f2c8ba3a25fd904 100644 (file)
@@ -164,6 +164,9 @@ static int keyring_get(struct credential *c)
                        if (g_strv_length(parts) >= 1) {
                                g_free(c->password);
                                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++) {
                                if (g_str_has_prefix(parts[i], "password_expiry_utc=")) {