summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Tan <jonathantanmy@google.com>2017-08-18 22:20:25 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-08-23 22:12:07 (GMT)
commite65f186242ccda24616e40681f46ad8d33da63e2 (patch)
tree64cd4b0b0bfad68916dbfa65b36ed7987122a7c1
parent9a4286537489f77b6e68f0ad0fc4398c4ec9846b (diff)
downloadgit-e65f186242ccda24616e40681f46ad8d33da63e2.zip
git-e65f186242ccda24616e40681f46ad8d33da63e2.tar.gz
git-e65f186242ccda24616e40681f46ad8d33da63e2.tar.bz2
pack: move install_packed_git()
Signed-off-by: Jonathan Tan <jonathantanmy@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--cache.h1
-rw-r--r--packfile.c11
-rw-r--r--packfile.h2
-rw-r--r--sha1_file.c9
4 files changed, 12 insertions, 11 deletions
diff --git a/cache.h b/cache.h
index 3b1526b..51b2318 100644
--- 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
diff --git a/packfile.c b/packfile.c
index efe0ed3..4eb65e4 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 e182f7f..e7d27c0 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 a5e13e0..13479a0 100644
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -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,