patch-ids.c: remove implicit dependency on the_index
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Nguyễn Thái Ngọc Duy committed
Sep 21, 2018 at 17:57 UTC
a7edadda593e34243c1cd3b3db750d502acf9b83
4 files changed
+6
-5
builtin/log.c
+1
-1
@@ -914,7 +914,7 @@ static void get_patch_ids(struct rev_info *rev, struct patch_ids *ids)
914
if ((flags1 & UNINTERESTING) == (flags2 & UNINTERESTING))
915
die(_("Not a range."));
916
917
- init_patch_ids(ids);
917
+ init_patch_ids(the_repository, ids);
918
919
/* given a range a..b get all patch ids for b..a */
920
init_revisions(&check_rev, rev->prefix);
patch-ids.c
+2
-2
@@ -56,10 +56,10 @@ static int patch_id_cmp(const void *cmpfn_data,
56
return oidcmp(&a->patch_id, &b->patch_id);
57
}
58
59
-int init_patch_ids(struct patch_ids *ids)
59
+int init_patch_ids(struct repository *r, struct patch_ids *ids)
60
{
61
memset(ids, 0, sizeof(*ids));
62
- repo_diff_setup(the_repository, &ids->diffopts);
62
+ repo_diff_setup(r, &ids->diffopts);
63
ids->diffopts.detect_rename = 0;
64
ids->diffopts.flags.recursive = 1;
65
diff_setup_done(&ids->diffopts);
patch-ids.h
+2
-1
@@ -6,6 +6,7 @@
6
7
struct commit;
8
struct object_id;
9
+struct repository;
10
11
struct patch_id {
12
struct hashmap_entry ent;
@@ -20,7 +21,7 @@ struct patch_ids {
21
22
int commit_patch_id(struct commit *commit, struct diff_options *options,
23
struct object_id *oid, int);
23
-int init_patch_ids(struct patch_ids *);
24
+int init_patch_ids(struct repository *, struct patch_ids *);
25
int free_patch_ids(struct patch_ids *);
26
struct patch_id *add_commit_patch_id(struct commit *, struct patch_ids *);
27
struct patch_id *has_commit_patch_id(struct commit *, struct patch_ids *);
revision.c
+1
-1
@@ -877,7 +877,7 @@ static void cherry_pick_list(struct commit_list *list, struct rev_info *revs)
877
return;
878
879
left_first = left_count < right_count;
880
- init_patch_ids(&ids);
880
+ init_patch_ids(the_repository, &ids);
881
ids.diffopts.pathspec = revs->diffopt.pathspec;
882
883
/* Compute patch-ids for one side */