diff options
| author | Michael Forney <mforney@mforney.org> | 2020-06-21 14:37:29 -0700 |
|---|---|---|
| committer | Michael Forney <mforney@mforney.org> | 2020-06-22 22:47:59 -0700 |
| commit | 9614d6ff951521d68a37101fb36d477c47819dd7 (patch) | |
| tree | 28fad132c6b0ff42222de9c55fe6cdec503fd5b6 /pkg/git/patch/0002-submodule-use-submodule-repository-when-preparing-su.patch | |
| parent | 88c27384043b7574f4ccb2cab45c728d4db2bac9 (diff) | |
git: Fix bug with submodule summary
Diffstat (limited to 'pkg/git/patch/0002-submodule-use-submodule-repository-when-preparing-su.patch')
| -rw-r--r-- | pkg/git/patch/0002-submodule-use-submodule-repository-when-preparing-su.patch | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/pkg/git/patch/0002-submodule-use-submodule-repository-when-preparing-su.patch b/pkg/git/patch/0002-submodule-use-submodule-repository-when-preparing-su.patch new file mode 100644 index 00000000..5a168d13 --- /dev/null +++ b/pkg/git/patch/0002-submodule-use-submodule-repository-when-preparing-su.patch @@ -0,0 +1,45 @@ +From a6b653527f20282c3eeff86551d4ca49b81861e3 Mon Sep 17 00:00:00 2001 +From: Michael Forney <mforney@mforney.org> +Date: Sun, 21 Jun 2020 14:31:53 -0700 +Subject: [PATCH] submodule: use submodule repository when preparing summary + +This prevents looking up a submodule commit in the outer repository's +commit graph, causing a fatal error. + +Signed-off-by: Michael Forney <mforney@mforney.org> +--- + submodule.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/submodule.c b/submodule.c +index e2ef5698c8..937c4f4fdc 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, ++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; + } +-- +2.27.0 + |
