Skip to content

Commit 13afa3c

Browse files
jeffhostetlermjcheetham
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 4826944 commit 13afa3c

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
@@ -782,6 +782,12 @@ void install_packed_git(struct repository *r, struct packed_git *pack)
782782
hashmap_add(&r->objects->pack_map, &pack->packmap_ent);
783783
}
784784

785+
void install_packed_git_and_mru(struct repository *r, struct packed_git *pack)
786+
{
787+
install_packed_git(r, pack);
788+
list_add(&pack->mru, &r->objects->packed_git_mru);
789+
}
790+
785791
void (*report_garbage)(unsigned seen_bits, const char *path);
786792

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

6969
void reprepare_packed_git(struct repository *r);
7070
void install_packed_git(struct repository *r, struct packed_git *pack);
71+
void install_packed_git_and_mru(struct repository *r, struct packed_git *pack);
7172

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

0 commit comments

Comments
 (0)