Commit d6fe0036 authored by Jonathan Tan's avatar Jonathan Tan Committed by Junio C Hamano

pack: move find_sha1_pack()

Signed-off-by: default avatarJonathan Tan <[email protected]>
Signed-off-by: default avatarJunio C Hamano <[email protected]>
parent a2551953
...@@ -1602,9 +1602,6 @@ struct pack_entry { ...@@ -1602,9 +1602,6 @@ struct pack_entry {
struct packed_git *p; struct packed_git *p;
}; };
extern struct packed_git *find_sha1_pack(const unsigned char *sha1,
struct packed_git *packs);
/* /*
* Create a temporary file rooted in the object database directory, or * Create a temporary file rooted in the object database directory, or
* die on failure. The filename is taken from "pattern", which should have the * die on failure. The filename is taken from "pattern", which should have the
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include "list-objects.h" #include "list-objects.h"
#include "sigchain.h" #include "sigchain.h"
#include "argv-array.h" #include "argv-array.h"
#include "packfile.h"
#ifdef EXPAT_NEEDS_XMLPARSE_H #ifdef EXPAT_NEEDS_XMLPARSE_H
#include <xmlparse.h> #include <xmlparse.h>
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#include "http.h" #include "http.h"
#include "list.h" #include "list.h"
#include "transport.h" #include "transport.h"
#include "packfile.h"
struct alt_base { struct alt_base {
char *base; char *base;
......
...@@ -1774,3 +1774,16 @@ int is_pack_valid(struct packed_git *p) ...@@ -1774,3 +1774,16 @@ int is_pack_valid(struct packed_git *p)
/* Force the pack to open to prove its valid. */ /* Force the pack to open to prove its valid. */
return !open_packed_git(p); return !open_packed_git(p);
} }
struct packed_git *find_sha1_pack(const unsigned char *sha1,
struct packed_git *packs)
{
struct packed_git *p;
for (p = packs; p; p = p->next) {
if (find_pack_entry_one(sha1, p))
return p;
}
return NULL;
}
...@@ -42,6 +42,9 @@ extern void install_packed_git(struct packed_git *pack); ...@@ -42,6 +42,9 @@ extern void install_packed_git(struct packed_git *pack);
*/ */
unsigned long approximate_object_count(void); unsigned long approximate_object_count(void);
extern struct packed_git *find_sha1_pack(const unsigned char *sha1,
struct packed_git *packs);
extern void pack_report(void); extern void pack_report(void);
/* /*
......
...@@ -1128,19 +1128,6 @@ static int find_pack_entry(const unsigned char *sha1, struct pack_entry *e) ...@@ -1128,19 +1128,6 @@ static int find_pack_entry(const unsigned char *sha1, struct pack_entry *e)
return 0; return 0;
} }
struct packed_git *find_sha1_pack(const unsigned char *sha1,
struct packed_git *packs)
{
struct packed_git *p;
for (p = packs; p; p = p->next) {
if (find_pack_entry_one(sha1, p))
return p;
}
return NULL;
}
static int sha1_loose_object_info(const unsigned char *sha1, static int sha1_loose_object_info(const unsigned char *sha1,
struct object_info *oi, struct object_info *oi,
int flags) int flags)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment