Skip to content

Commit 9b27ea9

Browse files
committed
Merge branch 'maint-1.6.0' into maint
* maint-1.6.0: Clear the delta base cache during fast-import checkpoint
2 parents 7e1100e + 3d20c63 commit 9b27ea9

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

cache.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -825,6 +825,7 @@ extern unsigned char* use_pack(struct packed_git *, struct pack_window **, off_t
825825
extern void close_pack_windows(struct packed_git *);
826826
extern void unuse_pack(struct pack_window **);
827827
extern void free_pack_by_name(const char *);
828+
extern void clear_delta_base_cache(void);
828829
extern struct packed_git *add_packed_git(const char *, int, int);
829830
extern const unsigned char *nth_packed_object_sha1(struct packed_git *, uint32_t);
830831
extern off_t nth_packed_object_offset(const struct packed_git *, uint32_t);

fast-import.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -944,6 +944,7 @@ static void end_packfile(void)
944944
{
945945
struct packed_git *old_p = pack_data, *new_p;
946946

947+
clear_delta_base_cache();
947948
if (object_count) {
948949
char *idx_name;
949950
int i;

sha1_file.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1663,6 +1663,13 @@ static inline void release_delta_base_cache(struct delta_base_cache_entry *ent)
16631663
}
16641664
}
16651665

1666+
void clear_delta_base_cache(void)
1667+
{
1668+
unsigned long p;
1669+
for (p = 0; p < MAX_DELTA_CACHE; p++)
1670+
release_delta_base_cache(&delta_base_cache[p]);
1671+
}
1672+
16661673
static void add_delta_base_cache(struct packed_git *p, off_t base_offset,
16671674
void *base, unsigned long base_size, enum object_type type)
16681675
{

0 commit comments

Comments
 (0)