Skip to content

Commit 55a21d0

Browse files
committed
object.c: clear_commit_marks_all() accept r as parameter
`clear_commit_marks_all()` and its callers are modified to enable passing `r` as an argument to `clear_commit_marks_all()`. Refer commit 60ffcbd. Signed-off-by: Parth Gala <[email protected]>
1 parent 34734be commit 55a21d0

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

builtin/checkout.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -991,6 +991,7 @@ static void suggest_reattach(struct commit *commit, struct rev_info *revs)
991991
static void orphaned_commit_warning(struct commit *old_commit, struct commit *new_commit)
992992
{
993993
struct rev_info revs;
994+
struct repository *r = the_repository;
994995
struct object *object = &old_commit->object;
995996

996997
repo_init_revisions(the_repository, &revs, NULL);
@@ -1013,7 +1014,7 @@ static void orphaned_commit_warning(struct commit *old_commit, struct commit *ne
10131014
describe_detached_head(_("Previous HEAD position was"), old_commit);
10141015

10151016
/* Clean up objects used, as they will be reused. */
1016-
clear_commit_marks_all(ALL_REV_FLAGS);
1017+
clear_commit_marks_all(r, ALL_REV_FLAGS);
10171018
}
10181019

10191020
static int switch_branches(const struct checkout_opts *opts,

object.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -453,12 +453,12 @@ void clear_object_flags(struct repository *r, unsigned flags)
453453
}
454454
}
455455

456-
void clear_commit_marks_all(unsigned int flags)
456+
void clear_commit_marks_all(struct repository *r, unsigned int flags)
457457
{
458458
int i;
459459

460-
for (i = 0; i < the_repository->parsed_objects->obj_hash_size; i++) {
461-
struct object *obj = the_repository->parsed_objects->obj_hash[i];
460+
for (i = 0; i < r->parsed_objects->obj_hash_size; i++) {
461+
struct object *obj = r->parsed_objects->obj_hash[i];
462462
if (obj && obj->type == OBJ_COMMIT)
463463
obj->flags &= ~flags;
464464
}

object.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,6 @@ void clear_object_flags(struct repository *, unsigned flags);
192192
/*
193193
* Clear the specified object flags from all in-core commit objects.
194194
*/
195-
void clear_commit_marks_all(unsigned int flags);
195+
void clear_commit_marks_all(struct repository *, unsigned int flags);
196196

197197
#endif /* OBJECT_H */

0 commit comments

Comments
 (0)