summaryrefslogtreecommitdiff
path: root/refs/packed-backend.h
diff options
context:
space:
mode:
authorLibravatar Michael Haggerty <mhagger@alum.mit.edu>2017-06-23 09:01:43 +0200
committerLibravatar Junio C Hamano <gitster@pobox.com>2017-06-23 13:27:33 -0700
commit49aebcf4328d96bb984672213de76cd4c45197f2 (patch)
treef84a389eead52efb743a15f9784fcc29be08ea74 /refs/packed-backend.h
parentpacked_refs_lock(): report errors via a `struct strbuf *err` (diff)
downloadtgif-49aebcf4328d96bb984672213de76cd4c45197f2.tar.xz
packed_refs_unlock(), packed_refs_is_locked(): new functions
Add two new public functions, `packed_refs_unlock()` and `packed_refs_is_locked()`, with which callers can manage and query the `packed-refs` lock externally. Call `packed_refs_unlock()` from `commit_packed_refs()` and `rollback_packed_refs()`. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'refs/packed-backend.h')
-rw-r--r--refs/packed-backend.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/refs/packed-backend.h b/refs/packed-backend.h
index 210e3f35ce..03b7c1de95 100644
--- a/refs/packed-backend.h
+++ b/refs/packed-backend.h
@@ -11,6 +11,9 @@ struct ref_store *packed_ref_store_create(const char *path,
*/
int packed_refs_lock(struct ref_store *ref_store, int flags, struct strbuf *err);
+void packed_refs_unlock(struct ref_store *ref_store);
+int packed_refs_is_locked(struct ref_store *ref_store);
+
void add_packed_ref(struct ref_store *ref_store,
const char *refname, const struct object_id *oid);