summaryrefslogtreecommitdiff
path: root/sha1_file.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-02-27 23:30:38 -0800
committerJunio C Hamano <gitster@pobox.com>2009-02-28 01:06:06 -0800
commitb8431b033f9e60f87a75b864612873307a3e5966 (patch)
treeb1f82e88e689757092e4a8b721ce2d49cb058cc6 /sha1_file.c
parentcd673c1f17228d272c4b7f81fbb28bc31cf0cac6 (diff)
downloadgit-b8431b033f9e60f87a75b864612873307a3e5966.tar.gz
has_sha1_kept_pack(): take "struct rev_info"
Its "ignore_packed" parameter always comes from struct rev_info. This patch makes the function take a pointer to the surrounding structure, so that the refactoring in the next patch becomes easier to review. There is an unfortunate header file dependency and the easiest workaround is to temporarily move the function declaration from cache.h to revision.h; this will be moved back to cache.h once the function loses this "ignore_packed" parameter altogether in the later part of the series. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'sha1_file.c')
-rw-r--r--sha1_file.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/sha1_file.c b/sha1_file.c
index ac4375d298..f963c3cadb 100644
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -16,6 +16,8 @@
#include "refs.h"
#include "pack-revindex.h"
#include "sha1-lookup.h"
+#include "diff.h"
+#include "revision.h"
#ifndef O_NOATIME
#if defined(__linux__) && (defined(__i386__) || defined(__PPC__))
@@ -1875,7 +1877,7 @@ int matches_pack_name(struct packed_git *p, const char *name)
}
static int find_pack_ent(const unsigned char *sha1, struct pack_entry *e,
- const char **ignore_packed)
+ const struct rev_info *revs)
{
static struct packed_git *last_found = (void *)1;
struct packed_git *p;
@@ -1887,9 +1889,9 @@ static int find_pack_ent(const unsigned char *sha1, struct pack_entry *e,
p = (last_found == (void *)1) ? packed_git : last_found;
do {
- if (ignore_packed) {
+ if (revs->ignore_packed) {
const char **ig;
- for (ig = ignore_packed; *ig; ig++)
+ for (ig = revs->ignore_packed; *ig; ig++)
if (matches_pack_name(p, *ig))
break;
if (*ig)
@@ -1941,9 +1943,9 @@ static int find_pack_entry(const unsigned char *sha1, struct pack_entry *e)
}
static int find_kept_pack_entry(const unsigned char *sha1, struct pack_entry *e,
- const char **ignore_packed)
+ const struct rev_info *revs)
{
- return find_pack_ent(sha1, e, ignore_packed);
+ return find_pack_ent(sha1, e, revs);
}
struct packed_git *find_sha1_pack(const unsigned char *sha1,
@@ -2413,10 +2415,10 @@ int has_sha1_pack(const unsigned char *sha1)
return find_pack_entry(sha1, &e);
}
-int has_sha1_kept_pack(const unsigned char *sha1, const char **ignore_packed)
+int has_sha1_kept_pack(const unsigned char *sha1, const struct rev_info *revs)
{
struct pack_entry e;
- return find_kept_pack_entry(sha1, &e, ignore_packed);
+ return find_kept_pack_entry(sha1, &e, revs);
}
int has_sha1_file(const unsigned char *sha1)