Skip to content

Commit e65f186

Browse files
jonathantanmygitster
authored andcommitted
pack: move install_packed_git()
Signed-off-by: Jonathan Tan <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 9a42865 commit e65f186

File tree

4 files changed

+12
-11
lines changed

4 files changed

+12
-11
lines changed

cache.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1613,7 +1613,6 @@ extern void (*report_garbage)(unsigned seen_bits, const char *path);
16131613

16141614
extern void prepare_packed_git(void);
16151615
extern void reprepare_packed_git(void);
1616-
extern void install_packed_git(struct packed_git *pack);
16171616

16181617
/*
16191618
* Give a rough count of objects in the repository. This sacrifices accuracy

packfile.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ static unsigned int pack_used_ctr;
2828
static unsigned int pack_mmap_calls;
2929
static unsigned int peak_pack_open_windows;
3030
static unsigned int pack_open_windows;
31-
unsigned int pack_open_fds;
31+
static unsigned int pack_open_fds;
3232
static unsigned int pack_max_fds;
3333
static size_t peak_pack_mapped;
3434
static size_t pack_mapped;
@@ -658,3 +658,12 @@ struct packed_git *add_packed_git(const char *path, size_t path_len, int local)
658658
hashclr(p->sha1);
659659
return p;
660660
}
661+
662+
void install_packed_git(struct packed_git *pack)
663+
{
664+
if (pack->pack_fd != -1)
665+
pack_open_fds++;
666+
667+
pack->next = packed_git;
668+
packed_git = pack;
669+
}

packfile.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ extern unsigned int pack_open_fds;
2828

2929
extern struct packed_git *parse_pack_index(unsigned char *sha1, const char *idx_path);
3030

31+
extern void install_packed_git(struct packed_git *pack);
32+
3133
extern void pack_report(void);
3234

3335
/*

sha1_file.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -719,15 +719,6 @@ void *xmmap(void *start, size_t length,
719719
return ret;
720720
}
721721

722-
void install_packed_git(struct packed_git *pack)
723-
{
724-
if (pack->pack_fd != -1)
725-
pack_open_fds++;
726-
727-
pack->next = packed_git;
728-
packed_git = pack;
729-
}
730-
731722
void (*report_garbage)(unsigned seen_bits, const char *path);
732723

733724
static void report_helper(const struct string_list *list,

0 commit comments

Comments
 (0)