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
This commit is contained in:
11
submodule.c
11
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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user