Thread (19 messages) flat view 19 messages, 1 author, 2016-06-15
DORMANTno replies

Revision v2 of 2 in this series.

Revisions (2)
  1. v1 [diff vs current]
  2. v2 current

[PATCH v2 17/18] read_loose_refs(): eliminate ref_cache argument

From: <hidden>
Date: 2016-06-15 22:53:40
Subsystem: the rest · Maintainer: Linus Torvalds

From: Michael Haggerty <redacted>

The ref_cache can now be read from the ref_dir.

Signed-off-by: Michael Haggerty <redacted>
---
 refs.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/refs.c b/refs.c
index 110e801..a0c687f 100644
--- a/refs.c
+++ b/refs.c
@@ -785,9 +785,9 @@ void add_packed_ref(const char *refname, const unsigned char *sha1)
  * dirname must end with '/'.  dir must be the directory entry
  * corresponding to dirname.
  */
-static void read_loose_refs(struct ref_cache *refs, const char *dirname,
-			    struct ref_dir *dir)
+static void read_loose_refs(const char *dirname, struct ref_dir *dir)
 {
+	struct ref_cache *refs = dir->ref_cache;
 	DIR *d;
 	const char *path;
 	struct dirent *de;
@@ -824,7 +824,7 @@ static void read_loose_refs(struct ref_cache *refs, const char *dirname,
 			/* Silently ignore. */
 		} else if (S_ISDIR(st.st_mode)) {
 			strbuf_addch(&refname, '/');
-			read_loose_refs(refs, refname.buf,
+			read_loose_refs(refname.buf,
 					search_for_subdir(dir, refname.buf, 1));
 		} else {
 			if (*refs->name) {
@@ -851,7 +851,7 @@ static struct ref_dir *get_loose_refs(struct ref_cache *refs)
 {
 	if (!refs->loose) {
 		refs->loose = create_dir_entry(refs, "");
-		read_loose_refs(refs, "refs/",
+		read_loose_refs("refs/",
 				search_for_subdir(get_ref_dir(refs->loose),
 						  "refs/", 1));
 	}
-- 
1.7.10
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help