Signed-off-by: Jonathan Tan <[email protected]>
---
cache.h | 1 -
pack.c | 9 +++++++++
pack.h | 1 +
sha1_file.c | 9 ---------
4 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/cache.h b/cache.h
index dd9f9a9ae..4812f3a63 100644
--- a/cache.h
+++ b/cache.h
@@ -1637,7 +1637,6 @@ extern int odb_mkstemp(struct strbuf *template, const
char *pattern);
*/
extern int odb_pack_keep(const char *name);
-extern void unuse_pack(struct pack_window **);
extern void clear_delta_base_cache(void);
extern struct packed_git *add_packed_git(const char *path, size_t path_len,
int local);
diff --git a/pack.c b/pack.c
index 85cb65558..93526ea7b 100644
--- a/pack.c
+++ b/pack.c
@@ -596,3 +596,12 @@ unsigned char *use_pack(struct packed_git *p,
*left = win->len - xsize_t(offset);
return win->base + offset;
}
+
+void unuse_pack(struct pack_window **w_cursor)
+{
+ struct pack_window *w = *w_cursor;
+ if (w) {
+ w->inuse_cnt--;
+ *w_cursor = NULL;
+ }
+}
diff --git a/pack.h b/pack.h
index bf2b99bf9..3876e9ae6 100644
--- a/pack.h
+++ b/pack.h
@@ -149,5 +149,6 @@ extern void close_all_packs(void);
extern int open_packed_git(struct packed_git *p);
extern unsigned char *use_pack(struct packed_git *, struct pack_window **,
off_t, unsigned long *);
+extern void unuse_pack(struct pack_window **);
#endif
diff --git a/sha1_file.c b/sha1_file.c
index 8f17a07e9..12501ef06 100644
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -717,15 +717,6 @@ void *xmmap(void *start, size_t length,
return ret;
}
-void unuse_pack(struct pack_window **w_cursor)
-{
- struct pack_window *w = *w_cursor;
- if (w) {
- w->inuse_cnt--;
- *w_cursor = NULL;
- }
-}
-
static struct packed_git *alloc_packed_git(int extra)
{
struct packed_git *p = xmalloc(st_add(sizeof(*p), extra));
--
2.14.0.434.g98096fd7a8-goog