]> git.ipfire.org Git - thirdparty/git.git/blobdiff - builtin/credential-store.c
Merge branch 'ad/t4129-setfacl-target-fix' into maint
[thirdparty/git.git] / builtin / credential-store.c
index 5331ab151a6f6052dc532ab32875f864070e3b72..ae3c1ba75fe60306f8819b1038660e73749aa83b 100644 (file)
@@ -1,4 +1,5 @@
 #include "builtin.h"
+#include "config.h"
 #include "lockfile.h"
 #include "credential.h"
 #include "string-list.h"
@@ -58,8 +59,11 @@ static void print_line(struct strbuf *buf)
 static void rewrite_credential_file(const char *fn, struct credential *c,
                                    struct strbuf *extra)
 {
-       if (hold_lock_file_for_update(&credential_lock, fn, 0) < 0)
-               die_errno("unable to get credential storage lock");
+       int timeout_ms = 1000;
+
+       git_config_get_int("credentialstore.locktimeoutms", &timeout_ms);
+       if (hold_lock_file_for_update_timeout(&credential_lock, fn, 0, timeout_ms) < 0)
+               die_errno(_("unable to get credential storage lock in %d ms"), timeout_ms);
        if (extra)
                print_line(extra);
        parse_credential_file(fn, c, NULL, print_line);