diff options
author | Junio C Hamano <gitster@pobox.com> | 2020-09-19 03:58:05 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-09-19 03:58:05 +0300 |
commit | 4831c23f75556df8906a508454d70faca0facd27 (patch) | |
tree | 755cd01f2b10015fc7de8c02281acd471636c868 /submodule.c | |
parent | 9d4e7ec4d9e695d95cc7474f59fba8cc38580e29 (diff) | |
parent | 85a1ec2c32f4f41dd4526651df4b3666a41334fe (diff) |
Merge branch 'mf/submodule-summary-with-correct-repository'
"git diff/show" on a change that involves a submodule used to read
the information on commits in the submodule from a wrong repository
and gave a wrong information when the commit-graph is involved.
* mf/submodule-summary-with-correct-repository:
submodule: use submodule repository when preparing summary
revision: use repository from rev_info when parsing commits
Diffstat (limited to 'submodule.c')
-rw-r--r-- | submodule.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/submodule.c b/submodule.c index b84438b7e0..543b1123ae 100644 --- a/submodule.c +++ b/submodule.c @@ -438,13 +438,14 @@ void handle_ignore_submodules_arg(struct diff_options *diffopt, */ } -static int prepare_submodule_diff_summary(struct rev_info *rev, const char *path, - struct commit *left, struct commit *right, - struct commit_list *merge_bases) +static int prepare_submodule_diff_summary(struct repository *r, struct rev_info *rev, + const char *path, + struct commit *left, struct commit *right, + struct commit_list *merge_bases) { struct commit_list *list; - repo_init_revisions(the_repository, rev, NULL); + repo_init_revisions(r, rev, NULL); setup_revisions(0, NULL, rev, NULL); rev->left_right = 1; rev->first_parent_only = 1; @@ -632,7 +633,7 @@ void show_submodule_diff_summary(struct diff_options *o, const char *path, goto out; /* Treat revision walker failure the same as missing commits */ - if (prepare_submodule_diff_summary(&rev, path, left, right, merge_bases)) { + if (prepare_submodule_diff_summary(sub, &rev, path, left, right, merge_bases)) { diff_emit_submodule_error(o, "(revision walker failed)\n"); goto out; } |