File tree Expand file tree Collapse file tree 2 files changed +23
-5
lines changed Expand file tree Collapse file tree 2 files changed +23
-5
lines changed Original file line number Diff line number Diff line change @@ -517,11 +517,13 @@ void free_island_marks(void)
517
517
{
518
518
struct island_bitmap * bitmap ;
519
519
520
- kh_foreach_value (island_marks , bitmap , {
521
- if (!-- bitmap -> refcount )
522
- free (bitmap );
523
- });
524
- kh_destroy_oid_map (island_marks );
520
+ if (island_marks ) {
521
+ kh_foreach_value (island_marks , bitmap , {
522
+ if (!-- bitmap -> refcount )
523
+ free (bitmap );
524
+ });
525
+ kh_destroy_oid_map (island_marks );
526
+ }
525
527
526
528
/* detect use-after-free with a an address which is never valid: */
527
529
island_marks = (void * )-1 ;
Original file line number Diff line number Diff line change @@ -1015,4 +1015,20 @@ test_expect_success 'complains when run outside of a repository' '
1015
1015
grep "not a git repository" err
1016
1016
'
1017
1017
1018
+ test_expect_success ' repack with delta islands' '
1019
+ git init repo &&
1020
+ test_when_finished "rm -fr repo" &&
1021
+ (
1022
+ cd repo &&
1023
+
1024
+ test_commit first &&
1025
+ git repack &&
1026
+ test_commit second &&
1027
+ git repack &&
1028
+
1029
+ git multi-pack-index write &&
1030
+ git -c repack.useDeltaIslands=true multi-pack-index repack
1031
+ )
1032
+ '
1033
+
1018
1034
test_done
You can’t perform that action at this time.
0 commit comments