]> git.ipfire.org Git - thirdparty/git.git/commitdiff
pack: move find_sha1_pack()
authorJonathan Tan <jonathantanmy@google.com>
Fri, 18 Aug 2017 22:20:34 +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>
cache.h
http-push.c
http-walker.c
packfile.c
packfile.h
sha1_file.c

diff --git a/cache.h b/cache.h
index c13345d641543871e3cc89c051647e8accce4b16..0f435cb3e5128386e267e59cffa36f6deff04998 100644 (file)
--- a/cache.h
+++ b/cache.h
@@ -1602,9 +1602,6 @@ struct pack_entry {
        struct packed_git *p;
 };
 
-extern struct packed_git *find_sha1_pack(const unsigned char *sha1,
-                                        struct packed_git *packs);
-
 /*
  * Create a temporary file rooted in the object database directory, or
  * die on failure. The filename is taken from "pattern", which should have the
index c91f40a610541d6201edf2a2c95b8fef203f3c2f..e4c9b065ce13ca2c4e522e20f603f192ddcb9306 100644 (file)
@@ -11,6 +11,7 @@
 #include "list-objects.h"
 #include "sigchain.h"
 #include "argv-array.h"
+#include "packfile.h"
 
 #ifdef EXPAT_NEEDS_XMLPARSE_H
 #include <xmlparse.h>
index ee049cb13df6ed6a64b1980004100a5dd55dde51..1ae8363de2bb618df534cc85c86eba3eac9e9c0a 100644 (file)
@@ -4,6 +4,7 @@
 #include "http.h"
 #include "list.h"
 #include "transport.h"
+#include "packfile.h"
 
 struct alt_base {
        char *base;
index 20562304b7035725b44b7b002b45e94838264827..135e95cb2eb07b7abcd51526ee08c7bff6169ab4 100644 (file)
@@ -1774,3 +1774,16 @@ int is_pack_valid(struct packed_git *p)
        /* Force the pack to open to prove its valid. */
        return !open_packed_git(p);
 }
+
+struct packed_git *find_sha1_pack(const unsigned char *sha1,
+                                 struct packed_git *packs)
+{
+       struct packed_git *p;
+
+       for (p = packs; p; p = p->next) {
+               if (find_pack_entry_one(sha1, p))
+                       return p;
+       }
+       return NULL;
+
+}
index 4ab15116c0125dcfb3c2dad54267cb986bd76c3c..e4d25d40d194dc5331da120ff594622d494ab0c6 100644 (file)
@@ -42,6 +42,9 @@ extern void install_packed_git(struct packed_git *pack);
  */
 unsigned long approximate_object_count(void);
 
+extern struct packed_git *find_sha1_pack(const unsigned char *sha1,
+                                        struct packed_git *packs);
+
 extern void pack_report(void);
 
 /*
index 365b4af3675d013a9bf9ea44fddc48f77cac8979..af3f1e5c5302a5f3df13d760696187be76da11ec 100644 (file)
@@ -1128,19 +1128,6 @@ static int find_pack_entry(const unsigned char *sha1, struct pack_entry *e)
        return 0;
 }
 
-struct packed_git *find_sha1_pack(const unsigned char *sha1,
-                                 struct packed_git *packs)
-{
-       struct packed_git *p;
-
-       for (p = packs; p; p = p->next) {
-               if (find_pack_entry_one(sha1, p))
-                       return p;
-       }
-       return NULL;
-
-}
-
 static int sha1_loose_object_info(const unsigned char *sha1,
                                  struct object_info *oi,
                                  int flags)