Thread (19 messages) 19 messages, 1 author, 2016-06-15

[PATCH v2 13/18] read_loose_refs(): rename function from get_ref_dir()

flat view
DORMANTno replies

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

Revision v2 of 2 in this series.

Revisions (2)
  1. v1 [diff vs current]
  2. v2 current
From: Michael Haggerty <redacted>

The new name better describes the function's purpose, and also makes
the old name available for a more suitable purpose.

Signed-off-by: Michael Haggerty <redacted>
---
 refs.c |   14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/refs.c b/refs.c
index de14e75..1d18ae6 100644
--- a/refs.c
+++ b/refs.c
@@ -769,8 +769,8 @@ 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 get_ref_dir(struct ref_cache *refs, const char *dirname,
-			struct ref_dir *dir)
+static void read_loose_refs(struct ref_cache *refs, const char *dirname,
+			    struct ref_dir *dir)
 {
 	DIR *d;
 	const char *path;
@@ -808,8 +808,8 @@ static void get_ref_dir(struct ref_cache *refs, const char *dirname,
 			/* Silently ignore. */
 		} else if (S_ISDIR(st.st_mode)) {
 			strbuf_addch(&refname, '/');
-			get_ref_dir(refs, refname.buf,
-				    &search_for_subdir(dir, refname.buf, 1)->u.subdir);
+			read_loose_refs(refs, refname.buf,
+					&search_for_subdir(dir, refname.buf, 1)->u.subdir);
 		} else {
 			if (*refs->name) {
 				hashclr(sha1);
@@ -835,9 +835,9 @@ static struct ref_dir *get_loose_refs(struct ref_cache *refs)
 {
 	if (!refs->loose) {
 		refs->loose = create_dir_entry("");
-		get_ref_dir(refs, "refs/",
-			    &search_for_subdir(&refs->loose->u.subdir,
-					       "refs/", 1)->u.subdir);
+		read_loose_refs(refs, "refs/",
+				&search_for_subdir(&refs->loose->u.subdir,
+						   "refs/", 1)->u.subdir);
 	}
 	return &refs->loose->u.subdir;
 }
-- 
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