Skip to content

Commit 98f37e6

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 <jeffhost@microsoft.com>
1 parent 8667c31 commit 98f37e6

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
@@ -768,6 +768,12 @@ void install_packed_git(struct repository *r, struct packed_git *pack)
768768
hashmap_add(&r->objects->pack_map, &pack->packmap_ent);
769769
}
770770

771+
void install_packed_git_and_mru(struct repository *r, struct packed_git *pack)
772+
{
773+
install_packed_git(r, pack);
774+
list_add(&pack->mru, &r->objects->packed_git_mru);
775+
}
776+
771777
void (*report_garbage)(unsigned seen_bits, const char *path);
772778

773779
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
@@ -67,6 +67,7 @@ extern void (*report_garbage)(unsigned seen_bits, const char *path);
6767

6868
void reprepare_packed_git(struct repository *r);
6969
void install_packed_git(struct repository *r, struct packed_git *pack);
70+
void install_packed_git_and_mru(struct repository *r, struct packed_git *pack);
7071

7172
struct packed_git *get_packed_git(struct repository *r);
7273
struct list_head *get_packed_git_mru(struct repository *r);

0 commit comments

Comments
 (0)