summaryrefslogtreecommitdiff
path: root/refs.c
diff options
context:
space:
mode:
authorMichael Haggerty <mhagger@alum.mit.edu>2012-04-26 22:27:06 (GMT)
committerJunio C Hamano <gitster@pobox.com>2012-05-03 20:15:36 (GMT)
commit423a1afc0bc48bb5520d518b521ecf9d79f59bb3 (patch)
treebe32f11e080ff92da1ff823beac6b0c6bd7513bb /refs.c
parentf006c42a11d5e97f5abc07b23f353ca64d5180e2 (diff)
downloadgit-423a1afc0bc48bb5520d518b521ecf9d79f59bb3.zip
git-423a1afc0bc48bb5520d518b521ecf9d79f59bb3.tar.gz
git-423a1afc0bc48bb5520d518b521ecf9d79f59bb3.tar.bz2
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>
Diffstat (limited to 'refs.c')
-rw-r--r--refs.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/refs.c b/refs.c
index 6720b90..746661e 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));
}