pack: move install_packed_git()
authorJonathan Tan <jonathantanmy@google.com>
Fri, 18 Aug 2017 22:20:25 +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
packfile.c
packfile.h
sha1_file.c
diff --git a/cache.h b/cache.h
index 3b1526b9ba7ce75a2f0fda1d257861036c8b4320..51b231833a27c8001326b008b33818c68bb1d128 100644 (file)
--- a/cache.h
+++ b/cache.h
@@ -1613,7 +1613,6 @@ extern void (*report_garbage)(unsigned seen_bits, const char *path);
 
 extern void prepare_packed_git(void);
 extern void reprepare_packed_git(void);
-extern void install_packed_git(struct packed_git *pack);
 
 /*
  * Give a rough count of objects in the repository. This sacrifices accuracy
index efe0ed3e833e6c66e01397bc01e2002a75ae1f1e..4eb65e4609da8f9fa7b82ad0c7ad7822fa9c2f31 100644 (file)
@@ -28,7 +28,7 @@ static unsigned int pack_used_ctr;
 static unsigned int pack_mmap_calls;
 static unsigned int peak_pack_open_windows;
 static unsigned int pack_open_windows;
-unsigned int pack_open_fds;
+static unsigned int pack_open_fds;
 static unsigned int pack_max_fds;
 static size_t peak_pack_mapped;
 static size_t pack_mapped;
@@ -658,3 +658,12 @@ struct packed_git *add_packed_git(const char *path, size_t path_len, int local)
                hashclr(p->sha1);
        return p;
 }
+
+void install_packed_git(struct packed_git *pack)
+{
+       if (pack->pack_fd != -1)
+               pack_open_fds++;
+
+       pack->next = packed_git;
+       packed_git = pack;
+}
index e182f7fd68ea07755276a4200660bf437fd5bea4..e7d27c0e978d4e285be79ce694e8e7de9d7a7ef0 100644 (file)
@@ -28,6 +28,8 @@ extern unsigned int pack_open_fds;
 
 extern struct packed_git *parse_pack_index(unsigned char *sha1, const char *idx_path);
 
+extern void install_packed_git(struct packed_git *pack);
+
 extern void pack_report(void);
 
 /*
index a5e13e0d98e7a5fb3aedcf5d3b307a2239ee83b7..13479a060c9c1bfd72df8c683e7fcff2ed92bd28 100644 (file)
@@ -719,15 +719,6 @@ void *xmmap(void *start, size_t length,
        return ret;
 }
 
-void install_packed_git(struct packed_git *pack)
-{
-       if (pack->pack_fd != -1)
-               pack_open_fds++;
-
-       pack->next = packed_git;
-       packed_git = pack;
-}
-
 void (*report_garbage)(unsigned seen_bits, const char *path);
 
 static void report_helper(const struct string_list *list,