Thread (47 messages) 47 messages, 4 authors, 2016-09-08

[PATCH v2 08/38] resolve_missing_loose_ref(): add a files_ref_store argument

flat view
STALE3693d

From: Michael Haggerty <hidden>
Date: 2016-09-04 16:10:52
Subsystem: the rest · Maintainer: Linus Torvalds

Revision v2 of 2 in this series.

Revisions (2)
  1. v1 [diff vs current]
  2. v2 current
Signed-off-by: Michael Haggerty <redacted>
Signed-off-by: Junio C Hamano <redacted>
---
 refs/files-backend.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/refs/files-backend.c b/refs/files-backend.c
index 2fc8ec9..0c92ace 100644
--- a/refs/files-backend.c
+++ b/refs/files-backend.c
@@ -1412,13 +1412,11 @@ static struct ref_entry *get_packed_ref(struct files_ref_store *refs,
 /*
  * A loose ref file doesn't exist; check for a packed ref.
  */
-static int resolve_missing_loose_ref(const char *refname,
+static int resolve_missing_loose_ref(struct files_ref_store *refs,
+				     const char *refname,
 				     unsigned char *sha1,
 				     unsigned int *flags)
 {
-	struct files_ref_store *refs =
-		get_files_ref_store(NULL, "resolve_missing_loose_ref");
-
 	struct ref_entry *entry;
 
 	/*
@@ -1438,6 +1436,8 @@ static int resolve_missing_loose_ref(const char *refname,
 int read_raw_ref(const char *refname, unsigned char *sha1,
 		 struct strbuf *referent, unsigned int *type)
 {
+	struct files_ref_store *refs =
+		get_files_ref_store(NULL, "read_raw_ref");
 	struct strbuf sb_contents = STRBUF_INIT;
 	struct strbuf sb_path = STRBUF_INIT;
 	const char *path;
@@ -1466,7 +1466,7 @@ int read_raw_ref(const char *refname, unsigned char *sha1,
 	if (lstat(path, &st) < 0) {
 		if (errno != ENOENT)
 			goto out;
-		if (resolve_missing_loose_ref(refname, sha1, type)) {
+		if (resolve_missing_loose_ref(refs, refname, sha1, type)) {
 			errno = ENOENT;
 			goto out;
 		}
@@ -1500,7 +1500,7 @@ int read_raw_ref(const char *refname, unsigned char *sha1,
 		 * ref is supposed to be, there could still be a
 		 * packed ref:
 		 */
-		if (resolve_missing_loose_ref(refname, sha1, type)) {
+		if (resolve_missing_loose_ref(refs, refname, sha1, type)) {
 			errno = EISDIR;
 			goto out;
 		}
-- 
2.9.3
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help