Skip to content

Commit 34734be

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

File tree

6 files changed

+11
-8
lines changed

6 files changed

+11
-8
lines changed

builtin/log.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1592,6 +1592,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
15921592
{
15931593
struct commit *commit;
15941594
struct commit **list = NULL;
1595+
struct repository *r = the_repository;
15951596
struct rev_info rev;
15961597
struct setup_revision_opt s_r_opt;
15971598
int nr = 0, total, i;
@@ -1998,7 +1999,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
19981999
if (base_commit) {
19992000
struct commit *base = get_base_commit(base_commit, list, nr);
20002001
reset_revision_walk();
2001-
clear_object_flags(UNINTERESTING);
2002+
clear_object_flags(r, UNINTERESTING);
20022003
prepare_bases(&bases, base, list, nr);
20032004
}
20042005

object.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -442,12 +442,12 @@ void object_array_remove_duplicates(struct object_array *array)
442442
}
443443
}
444444

445-
void clear_object_flags(unsigned flags)
445+
void clear_object_flags(struct repository *r, unsigned flags)
446446
{
447447
int i;
448448

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

object.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ void object_array_remove_duplicates(struct object_array *array);
187187
*/
188188
void object_array_clear(struct object_array *array);
189189

190-
void clear_object_flags(unsigned flags);
190+
void clear_object_flags(struct repository *, unsigned flags);
191191

192192
/*
193193
* Clear the specified object flags from all in-core commit objects.

revision.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3086,7 +3086,8 @@ static void set_children(struct rev_info *revs)
30863086

30873087
void reset_revision_walk(void)
30883088
{
3089-
clear_object_flags(SEEN | ADDED | SHOWN | TOPO_WALK_EXPLORED | TOPO_WALK_INDEGREE);
3089+
struct repository *r = the_repository;
3090+
clear_object_flags(r, SEEN | ADDED | SHOWN | TOPO_WALK_EXPLORED | TOPO_WALK_INDEGREE);
30903091
}
30913092

30923093
static int mark_uninteresting(const struct object_id *oid,

shallow.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,14 +180,15 @@ struct commit_list *get_shallow_commits_by_rev_list(int ac, const char **av,
180180
{
181181
struct commit_list *result = NULL, *p;
182182
struct commit_list *not_shallow_list = NULL;
183+
struct repository *r = the_repository;
183184
struct rev_info revs;
184185
int both_flags = shallow_flag | not_shallow_flag;
185186

186187
/*
187188
* SHALLOW (excluded) and NOT_SHALLOW (included) should not be
188189
* set at this point. But better be safe than sorry.
189190
*/
190-
clear_object_flags(both_flags);
191+
clear_object_flags(r, both_flags);
191192

192193
is_repository_shallow(the_repository); /* make sure shallows are read */
193194

upload-pack.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1473,7 +1473,7 @@ int upload_pack_v2(struct repository *r, struct argv_array *keys,
14731473
struct object_array have_obj = OBJECT_ARRAY_INIT;
14741474
struct object_array want_obj = OBJECT_ARRAY_INIT;
14751475

1476-
clear_object_flags(ALL_FLAGS);
1476+
clear_object_flags(r, ALL_FLAGS);
14771477

14781478
git_config(upload_pack_config, NULL);
14791479

0 commit comments

Comments
 (0)