Thread (47 messages) 47 messages, 4 authors, 2016-07-13

[PATCH 06/38] add_packed_ref(): add a files_ref_store argument

flat view
STALE3749d SUPERSEDED

From: Michael Haggerty <hidden>
Date: 2016-06-16 02:19:44
Subsystem: the rest · Maintainer: Linus Torvalds

Revision v1 of 2 in this series.

Revisions (2)
  1. v1 current
  2. v2 [diff vs current]
Signed-off-by: Michael Haggerty <redacted>
---
 refs/files-backend.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/refs/files-backend.c b/refs/files-backend.c
index 8ef79c2..5bfa912 100644
--- a/refs/files-backend.c
+++ b/refs/files-backend.c
@@ -1196,10 +1196,9 @@ static struct ref_dir *get_packed_refs(struct files_ref_store *refs)
  * lock_packed_refs()).  To actually write the packed-refs file, call
  * commit_packed_refs().
  */
-static void add_packed_ref(const char *refname, const unsigned char *sha1)
+static void add_packed_ref(struct files_ref_store *refs,
+			   const char *refname, const unsigned char *sha1)
 {
-	struct files_ref_store *refs =
-		get_files_ref_store(NULL, "add_packed_ref");
 	struct packed_ref_cache *packed_ref_cache = get_packed_ref_cache(refs);
 
 	if (!packed_ref_cache->lock)
@@ -3873,6 +3872,8 @@ static int ref_present(const char *refname,
 int initial_ref_transaction_commit(struct ref_transaction *transaction,
 				   struct strbuf *err)
 {
+	struct files_ref_store *refs =
+		get_files_ref_store(NULL, "initial_ref_transaction_commit");
 	int ret = 0, i;
 	struct ref_update **updates = transaction->updates;
 	struct string_list affected_refnames = STRING_LIST_INIT_NODUP;
@@ -3932,7 +3933,7 @@ int initial_ref_transaction_commit(struct ref_transaction *transaction,
 
 		if ((update->flags & REF_HAVE_NEW) &&
 		    !is_null_sha1(update->new_sha1))
-			add_packed_ref(update->refname, update->new_sha1);
+			add_packed_ref(refs, update->refname, update->new_sha1);
 	}
 
 	if (commit_packed_refs()) {
-- 
2.8.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help