diff options
author | Michael Forney <mforney@mforney.org> | 2020-06-23 13:56:59 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-06-24 09:13:08 -0700 |
commit | 85a1ec2c32f4f41dd4526651df4b3666a41334fe (patch) | |
tree | 52c79aafa293ad178c7aaa7e14981f7113ef067c /submodule.c | |
parent | ea3f7e598c8f1171f0bd02da777dc526cdb8424d (diff) | |
download | git-85a1ec2c32f4f41dd4526651df4b3666a41334fe.tar.gz |
submodule: use submodule repository when preparing summary
In show_submodule_header(), we gather the left and right commits
of the submodule repository, as well as the merge bases. However,
prepare_submodule_summary() initializes the rev_info with the_repository,
so we end up parsing the commit in the wrong repository.
This results in a fatal error in parse_commit_in_graph(), since the
passed item does not belong to the repository's commit graph.
Signed-off-by: Michael Forney <mforney@mforney.org>
Acked-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'submodule.c')
-rw-r--r-- | submodule.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/submodule.c b/submodule.c index 31f391d7d2..87df5fec92 100644 --- a/submodule.c +++ b/submodule.c @@ -438,13 +438,13 @@ void handle_ignore_submodules_arg(struct diff_options *diffopt, */ } -static int prepare_submodule_summary(struct rev_info *rev, const char *path, - struct commit *left, struct commit *right, +static int prepare_submodule_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 +632,7 @@ void show_submodule_summary(struct diff_options *o, const char *path, goto out; /* Treat revision walker failure the same as missing commits */ - if (prepare_submodule_summary(&rev, path, left, right, merge_bases)) { + if (prepare_submodule_summary(sub, &rev, path, left, right, merge_bases)) { diff_emit_submodule_error(o, "(revision walker failed)\n"); goto out; } |