extern int move_temp_to_file(const char *tmpfile, const char *filename);
extern int has_sha1_pack(const unsigned char *sha1);
+extern int has_sha1_kept_pack(const unsigned char *sha1);
extern int has_sha1_file(const unsigned char *sha1);
extern int has_loose_object_nonlocal(const unsigned char *sha1);
#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__))
return 0;
}
-int is_kept_pack(const struct packed_git *p)
-{
- return p->pack_keep;
-}
-
static int find_pack_ent(const unsigned char *sha1, struct pack_entry *e,
- const struct rev_info *revs)
+ int kept_pack_only)
{
static struct packed_git *last_found = (void *)1;
struct packed_git *p;
p = (last_found == (void *)1) ? packed_git : last_found;
do {
- if (revs->kept_pack_only && !is_kept_pack(p))
+ if (kept_pack_only && !p->pack_keep)
goto next;
if (p->num_bad_objects) {
unsigned i;
static int find_pack_entry(const unsigned char *sha1, struct pack_entry *e)
{
- return find_pack_ent(sha1, e, NULL);
+ return find_pack_ent(sha1, e, 0);
}
-static int find_kept_pack_entry(const unsigned char *sha1, struct pack_entry *e,
- const struct rev_info *revs)
+static int find_kept_pack_entry(const unsigned char *sha1, struct pack_entry *e)
{
- return find_pack_ent(sha1, e, revs);
+ return find_pack_ent(sha1, e, 1);
}
struct packed_git *find_sha1_pack(const unsigned char *sha1,
return find_pack_entry(sha1, &e);
}
-int has_sha1_kept_pack(const unsigned char *sha1, const struct rev_info *revs)
+int has_sha1_kept_pack(const unsigned char *sha1)
{
struct pack_entry e;
- return find_kept_pack_entry(sha1, &e, revs);
+ return find_kept_pack_entry(sha1, &e);
}
int has_sha1_file(const unsigned char *sha1)