Signed-off-by: Jonathan Tan <jonathantanmy@xxxxxxxxxx> --- cache.h | 1 - packfile.c | 11 ++++++++++- packfile.h | 2 ++ sha1_file.c | 9 --------- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/cache.h b/cache.h index 3625509f9..c4d8bee52 100644 --- a/cache.h +++ b/cache.h @@ -1619,7 +1619,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 diff --git a/packfile.c b/packfile.c index d1433d8c7..9a65aa4f6 100644 --- a/packfile.c +++ b/packfile.c @@ -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; +} diff --git a/packfile.h b/packfile.h index 1e932a49e..a18029184 100644 --- a/packfile.h +++ b/packfile.h @@ -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); /* diff --git a/sha1_file.c b/sha1_file.c index 0929fc10e..b77e7e3c3 100644 --- a/sha1_file.c +++ b/sha1_file.c @@ -718,15 +718,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, -- 2.14.1.480.gb18f417b89-goog