Skip to content

Commit d6fe003

Browse files
jonathantanmygitster
authored andcommitted
pack: move find_sha1_pack()
Signed-off-by: Jonathan Tan <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent a255195 commit d6fe003

File tree

6 files changed

+18
-16
lines changed

6 files changed

+18
-16
lines changed

cache.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1602,9 +1602,6 @@ struct pack_entry {
16021602
struct packed_git *p;
16031603
};
16041604

1605-
extern struct packed_git *find_sha1_pack(const unsigned char *sha1,
1606-
struct packed_git *packs);
1607-
16081605
/*
16091606
* Create a temporary file rooted in the object database directory, or
16101607
* die on failure. The filename is taken from "pattern", which should have the

http-push.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include "list-objects.h"
1212
#include "sigchain.h"
1313
#include "argv-array.h"
14+
#include "packfile.h"
1415

1516
#ifdef EXPAT_NEEDS_XMLPARSE_H
1617
#include <xmlparse.h>

http-walker.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include "http.h"
55
#include "list.h"
66
#include "transport.h"
7+
#include "packfile.h"
78

89
struct alt_base {
910
char *base;

packfile.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1774,3 +1774,16 @@ int is_pack_valid(struct packed_git *p)
17741774
/* Force the pack to open to prove its valid. */
17751775
return !open_packed_git(p);
17761776
}
1777+
1778+
struct packed_git *find_sha1_pack(const unsigned char *sha1,
1779+
struct packed_git *packs)
1780+
{
1781+
struct packed_git *p;
1782+
1783+
for (p = packs; p; p = p->next) {
1784+
if (find_pack_entry_one(sha1, p))
1785+
return p;
1786+
}
1787+
return NULL;
1788+
1789+
}

packfile.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ extern void install_packed_git(struct packed_git *pack);
4242
*/
4343
unsigned long approximate_object_count(void);
4444

45+
extern struct packed_git *find_sha1_pack(const unsigned char *sha1,
46+
struct packed_git *packs);
47+
4548
extern void pack_report(void);
4649

4750
/*

sha1_file.c

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1128,19 +1128,6 @@ static int find_pack_entry(const unsigned char *sha1, struct pack_entry *e)
11281128
return 0;
11291129
}
11301130

1131-
struct packed_git *find_sha1_pack(const unsigned char *sha1,
1132-
struct packed_git *packs)
1133-
{
1134-
struct packed_git *p;
1135-
1136-
for (p = packs; p; p = p->next) {
1137-
if (find_pack_entry_one(sha1, p))
1138-
return p;
1139-
}
1140-
return NULL;
1141-
1142-
}
1143-
11441131
static int sha1_loose_object_info(const unsigned char *sha1,
11451132
struct object_info *oi,
11461133
int flags)

0 commit comments

Comments
 (0)