]> git.ipfire.org Git - thirdparty/git.git/blobdiff - delta-islands.c
cocci: apply the "pretty.h" part of "the_repository.pending"
[thirdparty/git.git] / delta-islands.c
index 8b234cb85b03b26b3f7360420e65a8e88c6b2df0..05448851ad3d5fe01d098148d2bb6621846be0b6 100644 (file)
@@ -506,8 +506,9 @@ void propagate_island_marks(struct commit *commit)
                struct commit_list *p;
                struct island_bitmap *root_marks = kh_value(island_marks, pos);
 
-               parse_commit(commit);
-               set_island_marks(&get_commit_tree(commit)->object, root_marks);
+               repo_parse_commit(the_repository, commit);
+               set_island_marks(&repo_get_commit_tree(the_repository, commit)->object,
+                                root_marks);
                for (p = commit->parents; p; p = p->next)
                        set_island_marks(&p->item->object, root_marks);
        }
@@ -517,11 +518,13 @@ void free_island_marks(void)
 {
        struct island_bitmap *bitmap;
 
-       kh_foreach_value(island_marks, bitmap, {
-               if (!--bitmap->refcount)
-                       free(bitmap);
-       });
-       kh_destroy_oid_map(island_marks);
+       if (island_marks) {
+               kh_foreach_value(island_marks, bitmap, {
+                       if (!--bitmap->refcount)
+                               free(bitmap);
+               });
+               kh_destroy_oid_map(island_marks);
+       }
 
        /* detect use-after-free with a an address which is never valid: */
        island_marks = (void *)-1;