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>
This commit is contained in:
Michael Haggerty 2012-04-27 00:27:02 +02:00 committed by Junio C Hamano
parent d12229f532
commit 1900b976a4

6
refs.c
View File

@ -769,7 +769,7 @@ void add_packed_ref(const char *refname, const unsigned char *sha1)
* dirname must end with '/'. dir must be the directory entry * dirname must end with '/'. dir must be the directory entry
* corresponding to dirname. * corresponding to dirname.
*/ */
static void get_ref_dir(struct ref_cache *refs, const char *dirname, static void read_loose_refs(struct ref_cache *refs, const char *dirname,
struct ref_dir *dir) struct ref_dir *dir)
{ {
DIR *d; DIR *d;
@ -808,7 +808,7 @@ static void get_ref_dir(struct ref_cache *refs, const char *dirname,
; /* silently ignore */ ; /* silently ignore */
} else if (S_ISDIR(st.st_mode)) { } else if (S_ISDIR(st.st_mode)) {
strbuf_addch(&refname, '/'); strbuf_addch(&refname, '/');
get_ref_dir(refs, refname.buf, read_loose_refs(refs, refname.buf,
&search_for_subdir(dir, refname.buf, 1)->u.subdir); &search_for_subdir(dir, refname.buf, 1)->u.subdir);
} else { } else {
if (*refs->name) { if (*refs->name) {
@ -835,7 +835,7 @@ static struct ref_dir *get_loose_refs(struct ref_cache *refs)
{ {
if (!refs->loose) { if (!refs->loose) {
refs->loose = create_dir_entry(""); refs->loose = create_dir_entry("");
get_ref_dir(refs, "refs/", read_loose_refs(refs, "refs/",
&search_for_subdir(&refs->loose->u.subdir, &search_for_subdir(&refs->loose->u.subdir,
"refs/", 1)->u.subdir); "refs/", 1)->u.subdir);
} }