Skip to content

Commit 115ffd2

Browse files
jeffhostetlerdscho
authored andcommitted
packfile: add install_packed_git_and_mru()
Create a function to install a new packfile into the packed-git list and add it to the head of the MRU list. This function will be used in a later commit to install packfiles created by dynamic object fetching. Signed-off-by: Jeff Hostetler <[email protected]>
1 parent 6a13193 commit 115ffd2

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

packfile.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -796,6 +796,12 @@ void install_packed_git(struct repository *r, struct packed_git *pack)
796796
hashmap_add(&r->objects->pack_map, &pack->packmap_ent);
797797
}
798798

799+
void install_packed_git_and_mru(struct repository *r, struct packed_git *pack)
800+
{
801+
install_packed_git(r, pack);
802+
list_add(&pack->mru, &r->objects->packed_git_mru);
803+
}
804+
799805
void (*report_garbage)(unsigned seen_bits, const char *path);
800806

801807
static void report_helper(const struct string_list *list,

packfile.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ extern void (*report_garbage)(unsigned seen_bits, const char *path);
144144

145145
void reprepare_packed_git(struct repository *r);
146146
void install_packed_git(struct repository *r, struct packed_git *pack);
147+
void install_packed_git_and_mru(struct repository *r, struct packed_git *pack);
147148

148149
struct packed_git *get_packed_git(struct repository *r);
149150
struct list_head *get_packed_git_mru(struct repository *r);

0 commit comments

Comments
 (0)