Skip to content

Commit 150e300

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

File tree

7 files changed

+11
-8
lines changed

7 files changed

+11
-8
lines changed

builtin/prune-packed.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#include "cache.h"
33
#include "progress.h"
44
#include "parse-options.h"
5+
#include "packfile.h"
56

67
static const char * const prune_packed_usage[] = {
78
N_("git prune-packed [-n | --dry-run] [-q | --quiet]"),

cache.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1191,8 +1191,6 @@ extern int check_sha1_signature(const unsigned char *sha1, void *buf, unsigned l
11911191

11921192
extern int finalize_object_file(const char *tmpfile, const char *filename);
11931193

1194-
extern int has_sha1_pack(const unsigned char *sha1);
1195-
11961194
/*
11971195
* Open the loose object at path, check its sha1, and return the contents,
11981196
* type, and size. If the object is a blob, then "contents" may return NULL,

diff.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include "string-list.h"
2121
#include "argv-array.h"
2222
#include "graph.h"
23+
#include "packfile.h"
2324

2425
#ifdef NO_FAST_WORKING_DIRECTORY
2526
#define FAST_WORKING_DIRECTORY 0

packfile.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1840,3 +1840,9 @@ int find_pack_entry(const unsigned char *sha1, struct pack_entry *e)
18401840
}
18411841
return 0;
18421842
}
1843+
1844+
int has_sha1_pack(const unsigned char *sha1)
1845+
{
1846+
struct pack_entry e;
1847+
return find_pack_entry(sha1, &e);
1848+
}

packfile.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,4 +120,6 @@ extern const struct packed_git *has_packed_and_bad(const unsigned char *sha1);
120120

121121
extern int find_pack_entry(const unsigned char *sha1, struct pack_entry *e);
122122

123+
extern int has_sha1_pack(const unsigned char *sha1);
124+
123125
#endif

revision.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include "dir.h"
2020
#include "cache-tree.h"
2121
#include "bisect.h"
22+
#include "packfile.h"
2223

2324
volatile show_early_output_fn_t show_early_output;
2425

sha1_file.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1631,12 +1631,6 @@ int has_pack_index(const unsigned char *sha1)
16311631
return 1;
16321632
}
16331633

1634-
int has_sha1_pack(const unsigned char *sha1)
1635-
{
1636-
struct pack_entry e;
1637-
return find_pack_entry(sha1, &e);
1638-
}
1639-
16401634
int has_sha1_file_with_flags(const unsigned char *sha1, int flags)
16411635
{
16421636
if (!startup_info->have_repository)

0 commit comments

Comments
 (0)