Skip to content

Commit a7edadd

Browse files
pcloudsgitster
authored andcommitted
patch-ids.c: remove implicit dependency on the_index
Signed-off-by: Nguyễn Thái Ngọc Duy <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 7e196c3 commit a7edadd

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

builtin/log.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -914,7 +914,7 @@ static void get_patch_ids(struct rev_info *rev, struct patch_ids *ids)
914914
if ((flags1 & UNINTERESTING) == (flags2 & UNINTERESTING))
915915
die(_("Not a range."));
916916

917-
init_patch_ids(ids);
917+
init_patch_ids(the_repository, ids);
918918

919919
/* given a range a..b get all patch ids for b..a */
920920
init_revisions(&check_rev, rev->prefix);

patch-ids.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,10 @@ static int patch_id_cmp(const void *cmpfn_data,
5656
return oidcmp(&a->patch_id, &b->patch_id);
5757
}
5858

59-
int init_patch_ids(struct patch_ids *ids)
59+
int init_patch_ids(struct repository *r, struct patch_ids *ids)
6060
{
6161
memset(ids, 0, sizeof(*ids));
62-
repo_diff_setup(the_repository, &ids->diffopts);
62+
repo_diff_setup(r, &ids->diffopts);
6363
ids->diffopts.detect_rename = 0;
6464
ids->diffopts.flags.recursive = 1;
6565
diff_setup_done(&ids->diffopts);

patch-ids.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
struct commit;
88
struct object_id;
9+
struct repository;
910

1011
struct patch_id {
1112
struct hashmap_entry ent;
@@ -20,7 +21,7 @@ struct patch_ids {
2021

2122
int commit_patch_id(struct commit *commit, struct diff_options *options,
2223
struct object_id *oid, int);
23-
int init_patch_ids(struct patch_ids *);
24+
int init_patch_ids(struct repository *, struct patch_ids *);
2425
int free_patch_ids(struct patch_ids *);
2526
struct patch_id *add_commit_patch_id(struct commit *, struct patch_ids *);
2627
struct patch_id *has_commit_patch_id(struct commit *, struct patch_ids *);

revision.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -877,7 +877,7 @@ static void cherry_pick_list(struct commit_list *list, struct rev_info *revs)
877877
return;
878878

879879
left_first = left_count < right_count;
880-
init_patch_ids(&ids);
880+
init_patch_ids(the_repository, &ids);
881881
ids.diffopts.pathspec = revs->diffopt.pathspec;
882882

883883
/* Compute patch-ids for one side */

0 commit comments

Comments
 (0)