packed_refs_lock(): function renamed from lock_packed_refs()
Rename `lock_packed_refs()` to `packed_refs_lock()` for consistency with how other methods are named. Also, it's about to get some companions. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Michael Haggerty committed
Jun 23, 2017 at 09:01 UTC
b7de57d8d18a08ab517b4d01151129f521185271
3 files changed
+8
-8
refs/files-backend.c
+2
-2
@@ -1096,7 +1096,7 @@ static int files_pack_refs(struct ref_store *ref_store, unsigned int flags)
1096
struct ref_to_prune *refs_to_prune = NULL;
1097
struct strbuf err = STRBUF_INIT;
1098
1099
- lock_packed_refs(refs->packed_ref_store, LOCK_DIE_ON_ERROR);
1099
+ packed_refs_lock(refs->packed_ref_store, LOCK_DIE_ON_ERROR);
1100
1101
iter = cache_ref_iterator_begin(get_loose_ref_cache(refs), NULL, 0);
1102
while ((ok = ref_iterator_advance(iter)) == ITER_OK) {
@@ -2679,7 +2679,7 @@ static int files_initial_transaction_commit(struct ref_store *ref_store,
2679
}
2680
}
2681
2682
- if (lock_packed_refs(refs->packed_ref_store, 0)) {
2682
+ if (packed_refs_lock(refs->packed_ref_store, 0)) {
2683
strbuf_addf(err, "unable to lock packed-refs file: %s",
2684
strerror(errno));
2685
ret = TRANSACTION_GENERIC_ERROR;
refs/packed-backend.c
+5
-5
@@ -321,7 +321,7 @@ static struct ref_dir *get_packed_refs(struct packed_ref_store *refs)
321
/*
322
* Add or overwrite a reference in the in-memory packed reference
323
* cache. This may only be called while the packed-refs file is locked
324
- * (see lock_packed_refs()). To actually write the packed-refs file,
324
+ * (see packed_refs_lock()). To actually write the packed-refs file,
325
* call commit_packed_refs().
326
*/
327
void add_packed_ref(struct ref_store *ref_store,
@@ -515,11 +515,11 @@ static int write_packed_entry(FILE *fh, const char *refname,
515
return 0;
516
}
517
518
-int lock_packed_refs(struct ref_store *ref_store, int flags)
518
+int packed_refs_lock(struct ref_store *ref_store, int flags)
519
{
520
struct packed_ref_store *refs =
521
packed_downcast(ref_store, REF_STORE_WRITE | REF_STORE_MAIN,
522
- "lock_packed_refs");
522
+ "packed_refs_lock");
523
static int timeout_configured = 0;
524
static int timeout_value = 1000;
525
struct packed_ref_cache *packed_ref_cache;
@@ -567,7 +567,7 @@ static const char PACKED_REFS_HEADER[] =
567
/*
568
* Write the current version of the packed refs cache from memory to
569
* disk. The packed-refs file must already be locked for writing (see
570
- * lock_packed_refs()). Return zero on success. On errors, rollback
570
+ * packed_refs_lock()). Return zero on success. On errors, rollback
571
* the lockfile, write an error message to `err`, and return a nonzero
572
* value.
573
*/
@@ -698,7 +698,7 @@ int repack_without_refs(struct ref_store *ref_store,
698
if (!needs_repacking)
699
return 0; /* no refname exists in packed refs */
700
701
- if (lock_packed_refs(&refs->base, 0)) {
701
+ if (packed_refs_lock(&refs->base, 0)) {
702
unable_to_lock_message(refs->path, errno, err);
703
return -1;
704
}
refs/packed-backend.h
+1
-1
@@ -9,7 +9,7 @@ struct ref_store *packed_ref_store_create(const char *path,
9
* hold_lock_file_for_update(). Return 0 on success. On errors, set
10
* errno appropriately and return a nonzero value.
11
*/
12
-int lock_packed_refs(struct ref_store *ref_store, int flags);
12
+int packed_refs_lock(struct ref_store *ref_store, int flags);
13
14
void add_packed_ref(struct ref_store *ref_store,
15
const char *refname, const struct object_id *oid);