diff options
author | Michael Haggerty <mhagger@alum.mit.edu> | 2011-12-12 06:38:46 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-12-12 09:08:56 -0800 |
commit | 04f8fc2016c009ace896b11763f3ca0ccfdc14a3 (patch) | |
tree | 60ec7d0a04731139b8d4541ee838f0613ee191ec | |
parent | a3c9d83c05225bdcfa696b851e7f7f71dc61c64d (diff) | |
download | git-04f8fc2016c009ace896b11763f3ca0ccfdc14a3.tar.gz |
read_packed_refs(): take (ref_entry *) instead of (ref_dir *)
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r-- | refs.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -670,12 +670,13 @@ static const char *parse_ref_line(char *line, unsigned char *sha1) return line; } -static void read_packed_refs(FILE *f, struct ref_dir *dir) +static void read_packed_refs(FILE *f, struct ref_entry *direntry) { struct ref_entry *last = NULL; char refline[PATH_MAX]; int flag = REF_ISPACKED; + assert(direntry->flag & REF_DIR); while (fgets(refline, sizeof(refline), f)) { unsigned char sha1[20]; const char *refname; @@ -692,7 +693,7 @@ static void read_packed_refs(FILE *f, struct ref_dir *dir) refname = parse_ref_line(refline, sha1); if (refname) { last = create_ref_entry(refname, sha1, flag, 1); - add_ref(dir, last); + add_ref(&direntry->u.subdir, last); continue; } if (last && @@ -732,7 +733,7 @@ static struct ref_entry *get_packed_refs(struct ref_cache *refs) packed_refs_file = git_path("packed-refs"); f = fopen(packed_refs_file, "r"); if (f) { - read_packed_refs(f, &refs->packed->u.subdir); + read_packed_refs(f, refs->packed); fclose(f); } } |