read_loose_refs(): rename function from get_ref_dir()
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 <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Michael Haggerty committed
Apr 27, 2012 at 00:27 UTC
1900b976a4a3d06c22d57031efece81947539337
1 file changed
+7
-7
refs.c
+7
-7
@@ -769,8 +769,8 @@ void add_packed_ref(const char *refname, const unsigned char *sha1)
769
* dirname must end with '/'. dir must be the directory entry
770
* corresponding to dirname.
771
*/
772
-static void get_ref_dir(struct ref_cache *refs, const char *dirname,
773
- struct ref_dir *dir)
772
+static void read_loose_refs(struct ref_cache *refs, const char *dirname,
773
+ struct ref_dir *dir)
774
{
775
DIR *d;
776
const char *path;
@@ -808,8 +808,8 @@ static void get_ref_dir(struct ref_cache *refs, const char *dirname,
808
; /* silently ignore */
809
} else if (S_ISDIR(st.st_mode)) {
810
strbuf_addch(&refname, '/');
811
- get_ref_dir(refs, refname.buf,
812
- &search_for_subdir(dir, refname.buf, 1)->u.subdir);
811
+ read_loose_refs(refs, refname.buf,
812
+ &search_for_subdir(dir, refname.buf, 1)->u.subdir);
813
} else {
814
if (*refs->name) {
815
hashclr(sha1);
@@ -835,9 +835,9 @@ static struct ref_dir *get_loose_refs(struct ref_cache *refs)
835
{
836
if (!refs->loose) {
837
refs->loose = create_dir_entry("");
838
- get_ref_dir(refs, "refs/",
839
- &search_for_subdir(&refs->loose->u.subdir,
840
- "refs/", 1)->u.subdir);
838
+ read_loose_refs(refs, "refs/",
839
+ &search_for_subdir(&refs->loose->u.subdir,
840
+ "refs/", 1)->u.subdir);
841
}
842
return &refs->loose->u.subdir;
843
}