summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Tan <jonathantanmy@google.com>2017-08-18 15:20:36 -0700
committerJunio C Hamano <gitster@pobox.com>2017-08-23 15:12:07 -0700
commit150e3001d0c5cc69db72a10f3e0cd1e14f11acba (patch)
tree9ce033e4fa202c7843233b1245806bd5d7523f0d
parent1a1e5d4f47fd77dec1b7e7ef0867939a251252b6 (diff)
downloadgit-150e3001d0c5cc69db72a10f3e0cd1e14f11acba.tar.gz
pack: move has_sha1_pack()
Signed-off-by: Jonathan Tan <jonathantanmy@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--builtin/prune-packed.c1
-rw-r--r--cache.h2
-rw-r--r--diff.c1
-rw-r--r--packfile.c6
-rw-r--r--packfile.h2
-rw-r--r--revision.c1
-rw-r--r--sha1_file.c6
7 files changed, 11 insertions, 8 deletions
diff --git a/builtin/prune-packed.c b/builtin/prune-packed.c
index ac978ad401..97bfde24ba 100644
--- a/builtin/prune-packed.c
+++ b/builtin/prune-packed.c
@@ -2,6 +2,7 @@
#include "cache.h"
#include "progress.h"
#include "parse-options.h"
+#include "packfile.h"
static const char * const prune_packed_usage[] = {
N_("git prune-packed [-n | --dry-run] [-q | --quiet]"),
diff --git a/cache.h b/cache.h
index 0f435cb3e5..a2897bc7d1 100644
--- a/cache.h
+++ b/cache.h
@@ -1191,8 +1191,6 @@ extern int check_sha1_signature(const unsigned char *sha1, void *buf, unsigned l
extern int finalize_object_file(const char *tmpfile, const char *filename);
-extern int has_sha1_pack(const unsigned char *sha1);
-
/*
* Open the loose object at path, check its sha1, and return the contents,
* type, and size. If the object is a blob, then "contents" may return NULL,
diff --git a/diff.c b/diff.c
index 9c71201e9c..4c60990f70 100644
--- a/diff.c
+++ b/diff.c
@@ -20,6 +20,7 @@
#include "string-list.h"
#include "argv-array.h"
#include "graph.h"
+#include "packfile.h"
#ifdef NO_FAST_WORKING_DIRECTORY
#define FAST_WORKING_DIRECTORY 0
diff --git a/packfile.c b/packfile.c
index 22bdbbcf2c..322c43d74a 100644
--- a/packfile.c
+++ b/packfile.c
@@ -1840,3 +1840,9 @@ int find_pack_entry(const unsigned char *sha1, struct pack_entry *e)
}
return 0;
}
+
+int has_sha1_pack(const unsigned char *sha1)
+{
+ struct pack_entry e;
+ return find_pack_entry(sha1, &e);
+}
diff --git a/packfile.h b/packfile.h
index a0a3c08ff2..420fcdb2b9 100644
--- a/packfile.h
+++ b/packfile.h
@@ -120,4 +120,6 @@ extern const struct packed_git *has_packed_and_bad(const unsigned char *sha1);
extern int find_pack_entry(const unsigned char *sha1, struct pack_entry *e);
+extern int has_sha1_pack(const unsigned char *sha1);
+
#endif
diff --git a/revision.c b/revision.c
index aa3b946a8d..94a5e98525 100644
--- a/revision.c
+++ b/revision.c
@@ -19,6 +19,7 @@
#include "dir.h"
#include "cache-tree.h"
#include "bisect.h"
+#include "packfile.h"
volatile show_early_output_fn_t show_early_output;
diff --git a/sha1_file.c b/sha1_file.c
index af7102cd6a..32f4867289 100644
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -1631,12 +1631,6 @@ int has_pack_index(const unsigned char *sha1)
return 1;
}
-int has_sha1_pack(const unsigned char *sha1)
-{
- struct pack_entry e;
- return find_pack_entry(sha1, &e);
-}
-
int has_sha1_file_with_flags(const unsigned char *sha1, int flags)
{
if (!startup_info->have_repository)