]> git.ipfire.org Git - thirdparty/git.git/commitdiff
pack: move has_sha1_pack()
authorJonathan Tan <jonathantanmy@google.com>
Fri, 18 Aug 2017 22:20:36 +0000 (15:20 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 23 Aug 2017 22:12:07 +0000 (15:12 -0700)
Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/prune-packed.c
cache.h
diff.c
packfile.c
packfile.h
revision.c
sha1_file.c

index ac978ad401c01c4f44d3134b95a2bcb8b29973f9..97bfde24ba6f85ea9077357f162151d7a4c80e09 100644 (file)
@@ -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 0f435cb3e5128386e267e59cffa36f6deff04998..a2897bc7d1df9b43284257b771d9b79fd3324e65 100644 (file)
--- 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 9c71201e9cbaed28a1f990114484ac75425ee19f..4c60990f7058fda57d0ed450df51aa251065b3ab 100644 (file)
--- 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
index 22bdbbcf2c0aac6c9845c3bf5fc25ab40df16112..322c43d74a9100e7758a9cb92075441415c07b42 100644 (file)
@@ -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);
+}
index a0a3c08ff2bb5b4b216f70043b3980212c405a84..420fcdb2b99267d4258b4e39f602d69902256ebe 100644 (file)
@@ -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
index aa3b946a8d831702f503f3b91d6866d190aef885..94a5e98525187a2d7f1c6f4e9a22f4cb3bb0cf84 100644 (file)
@@ -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;
 
index af7102cd6a351607ed680905f8578e98f41a172e..32f48672890fc33e461e6bd0da523735def46240 100644 (file)
@@ -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)