pack: move has_sha1_pack()

Signed-off-by: Jonathan Tan <jonathantanmy@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jonathan Tan committed Aug 18, 2017 at 15:20 UTC 150e3001d0c5cc69db72a10f3e0cd1e14f11acba
7 files changed +11 -8
builtin/prune-packed.c
+1
@@ -2,6 +2,7 @@
2 #include "cache.h"
3 #include "progress.h"
4 #include "parse-options.h"
5 +#include "packfile.h"
6
7 static const char * const prune_packed_usage[] = {
8 N_("git prune-packed [-n | --dry-run] [-q | --quiet]"),
cache.h
-2
@@ -1191,8 +1191,6 @@ extern int check_sha1_signature(const unsigned char *sha1, void *buf, unsigned l
1191
1192 extern int finalize_object_file(const char *tmpfile, const char *filename);
1193
1194 -extern int has_sha1_pack(const unsigned char *sha1);
1195 -
1194 /*
1195 * Open the loose object at path, check its sha1, and return the contents,
1196 * type, and size. If the object is a blob, then "contents" may return NULL,
diff.c
+1
@@ -20,6 +20,7 @@
20 #include "string-list.h"
21 #include "argv-array.h"
22 #include "graph.h"
23 +#include "packfile.h"
24
25 #ifdef NO_FAST_WORKING_DIRECTORY
26 #define FAST_WORKING_DIRECTORY 0
packfile.c
+6
@@ -1840,3 +1840,9 @@ int find_pack_entry(const unsigned char *sha1, struct pack_entry *e)
1840 }
1841 return 0;
1842 }
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
+2
@@ -120,4 +120,6 @@ extern const struct packed_git *has_packed_and_bad(const unsigned char *sha1);
120
121 extern int find_pack_entry(const unsigned char *sha1, struct pack_entry *e);
122
123 +extern int has_sha1_pack(const unsigned char *sha1);
124 +
125 #endif
revision.c
+1
@@ -19,6 +19,7 @@
19 #include "dir.h"
20 #include "cache-tree.h"
21 #include "bisect.h"
22 +#include "packfile.h"
23
24 volatile show_early_output_fn_t show_early_output;
25
sha1_file.c
-6
@@ -1631,12 +1631,6 @@ int has_pack_index(const unsigned char *sha1)
1631 return 1;
1632 }
1633
1634 -int has_sha1_pack(const unsigned char *sha1)
1635 -{
1636 - struct pack_entry e;
1637 - return find_pack_entry(sha1, &e);
1638 -}
1639 -
1634 int has_sha1_file_with_flags(const unsigned char *sha1, int flags)
1635 {
1636 if (!startup_info->have_repository)