Skip to content

Commit 746d9ff

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()'. Signed-off-by: Parth Gala <[email protected]>
1 parent a8202cc commit 746d9ff

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
@@ -989,6 +989,7 @@ static void suggest_reattach(struct commit *commit, struct rev_info *revs)
989989
static void orphaned_commit_warning(struct commit *old_commit, struct commit *new_commit)
990990
{
991991
struct rev_info revs;
992+
struct repository *r = the_repository;
992993
struct object *object = &old_commit->object;
993994

994995
repo_init_revisions(the_repository, &revs, NULL);
@@ -1011,7 +1012,7 @@ static void orphaned_commit_warning(struct commit *old_commit, struct commit *ne
10111012
describe_detached_head(_("Previous HEAD position was"), old_commit);
10121013

10131014
/* Clean up objects used, as they will be reused. */
1014-
clear_commit_marks_all(ALL_REV_FLAGS);
1015+
clear_commit_marks_all(r, ALL_REV_FLAGS);
10151016
}
10161017

10171018
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
@@ -443,12 +443,12 @@ void clear_object_flags(struct repository *r, unsigned flags)
443443
}
444444
}
445445

446-
void clear_commit_marks_all(unsigned int flags)
446+
void clear_commit_marks_all(struct repository *r, unsigned int flags)
447447
{
448448
int i;
449449

450-
for (i = 0; i < the_repository->parsed_objects->obj_hash_size; i++) {
451-
struct object *obj = the_repository->parsed_objects->obj_hash[i];
450+
for (i = 0; i < r->parsed_objects->obj_hash_size; i++) {
451+
struct object *obj = r->parsed_objects->obj_hash[i];
452452
if (obj && obj->type == OBJ_COMMIT)
453453
obj->flags &= ~flags;
454454
}

object.h

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

195195
#endif /* OBJECT_H */

0 commit comments

Comments
 (0)