read_loose_refs(): eliminate ref_cache argument

The ref_cache can now be read from the ref_dir. 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 423a1afc0bc48bb5520d518b521ecf9d79f59bb3
1 file changed +4 -4
refs.c
+4 -4
@@ -785,9 +785,9 @@ void add_packed_ref(const char *refname, const unsigned char *sha1)
785 * dirname must end with '/'. dir must be the directory entry
786 * corresponding to dirname.
787 */
788 -static void read_loose_refs(struct ref_cache *refs, const char *dirname,
789 - struct ref_dir *dir)
788 +static void read_loose_refs(const char *dirname, struct ref_dir *dir)
789 {
790 + struct ref_cache *refs = dir->ref_cache;
791 DIR *d;
792 const char *path;
793 struct dirent *de;
@@ -824,7 +824,7 @@ static void read_loose_refs(struct ref_cache *refs, const char *dirname,
824 ; /* silently ignore */
825 } else if (S_ISDIR(st.st_mode)) {
826 strbuf_addch(&refname, '/');
827 - read_loose_refs(refs, refname.buf,
827 + read_loose_refs(refname.buf,
828 search_for_subdir(dir, refname.buf, 1));
829 } else {
830 if (*refs->name) {
@@ -851,7 +851,7 @@ static struct ref_dir *get_loose_refs(struct ref_cache *refs)
851 {
852 if (!refs->loose) {
853 refs->loose = create_dir_entry(refs, "");
854 - read_loose_refs(refs, "refs/",
854 + read_loose_refs("refs/",
855 search_for_subdir(get_ref_dir(refs->loose),
856 "refs/", 1));
857 }