diff options
Diffstat (limited to 'pack-bitmap.c')
-rw-r--r-- | pack-bitmap.c | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/pack-bitmap.c b/pack-bitmap.c index 6a818419c..62a98cc11 100644 --- a/pack-bitmap.c +++ b/pack-bitmap.c @@ -60,7 +60,7 @@ static struct bitmap_index { struct ewah_bitmap *blobs; struct ewah_bitmap *tags; - /* Map from SHA1 -> `stored_bitmap` for all the bitmapped comits */ + /* Map from SHA1 -> `stored_bitmap` for all the bitmapped commits */ khash_sha1 *bitmaps; /* Number of bitmapped commits */ @@ -252,6 +252,20 @@ static int load_bitmap_entries_v1(struct bitmap_index *index) return 0; } +static char *pack_bitmap_filename(struct packed_git *p) +{ + char *idx_name; + int len; + + len = strlen(p->pack_name) - strlen(".pack"); + idx_name = xmalloc(len + strlen(".bitmap") + 1); + + memcpy(idx_name, p->pack_name, len); + memcpy(idx_name + len, ".bitmap", strlen(".bitmap") + 1); + + return idx_name; +} + static int open_pack_bitmap_1(struct packed_git *packfile) { int fd; @@ -322,20 +336,6 @@ failed: return -1; } -char *pack_bitmap_filename(struct packed_git *p) -{ - char *idx_name; - int len; - - len = strlen(p->pack_name) - strlen(".pack"); - idx_name = xmalloc(len + strlen(".bitmap") + 1); - - memcpy(idx_name, p->pack_name, len); - memcpy(idx_name + len, ".bitmap", strlen(".bitmap") + 1); - - return idx_name; -} - static int open_pack_bitmap(void) { struct packed_git *p; @@ -986,6 +986,8 @@ void test_bitmap_walk(struct rev_info *revs) fprintf(stderr, "OK!\n"); else fprintf(stderr, "Mismatch!\n"); + + free(result); } static int rebuild_bitmap(uint32_t *reposition, |