-#define USE_THE_REPOSITORY_VARIABLE
#define DISABLE_SIGN_COMPARE_WARNINGS
#include "../git-compat-util.h"
* `packed_ref_store`) must not be freed.
*/
struct tempfile *tempfile;
+
+ /*
+ * Timeout when taking the "packed-refs.lock" file. configurable via
+ * "core.packedRefsTimeout".
+ */
+ bool timeout_configured;
+ int timeout_value;
};
/*
struct packed_ref_store *refs =
packed_downcast(ref_store, REF_STORE_WRITE | REF_STORE_MAIN,
"packed_refs_lock");
- static int timeout_configured = 0;
- static int timeout_value = 1000;
- if (!timeout_configured) {
- repo_config_get_int(the_repository, "core.packedrefstimeout", &timeout_value);
- timeout_configured = 1;
+ if (!refs->timeout_configured) {
+ if (repo_config_get_int(ref_store->repo, "core.packedrefstimeout",
+ &refs->timeout_value))
+ refs->timeout_value = 1000;
+ refs->timeout_configured = true;
}
/*
if (hold_lock_file_for_update_timeout(
&refs->lock,
refs->path,
- flags, timeout_value) < 0) {
+ flags, refs->timeout_value) < 0) {
unable_to_lock_message(refs->path, errno, err);
return -1;
}