@@ -989,6 +989,7 @@ static void suggest_reattach(struct commit *commit, struct rev_info *revs)
static void orphaned_commit_warning(struct commit *old_commit, struct commit *new_commit)
{
struct rev_info revs;
+ struct repository *r = the_repository;
struct object *object = &old_commit->object;
repo_init_revisions(the_repository, &revs, NULL);
@@ -1011,7 +1012,7 @@ static void orphaned_commit_warning(struct commit *old_commit, struct commit *ne
describe_detached_head(_("Previous HEAD position was"), old_commit);
/* Clean up objects used, as they will be reused. */
- clear_commit_marks_all(ALL_REV_FLAGS);
+ clear_commit_marks_all(r, ALL_REV_FLAGS);
}
static int switch_branches(const struct checkout_opts *opts,
@@ -443,12 +443,12 @@ void clear_object_flags(struct repository *r, unsigned flags)
}
}
-void clear_commit_marks_all(unsigned int flags)
+void clear_commit_marks_all(struct repository *r, unsigned int flags)
{
int i;
- for (i = 0; i < the_repository->parsed_objects->obj_hash_size; i++) {
- struct object *obj = the_repository->parsed_objects->obj_hash[i];
+ for (i = 0; i < r->parsed_objects->obj_hash_size; i++) {
+ struct object *obj = r->parsed_objects->obj_hash[i];
if (obj && obj->type == OBJ_COMMIT)
obj->flags &= ~flags;
}
@@ -190,6 +190,6 @@ void clear_object_flags(struct repository *, unsigned flags);
/*
* Clear the specified object flags from all in-core commit objects.
*/
-void clear_commit_marks_all(unsigned int flags);
+void clear_commit_marks_all(struct repository *, unsigned int flags);
#endif /* OBJECT_H */