Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Cai <johncai86@gmail.com>2023-10-09 16:21:00 +0300
committerJunio C Hamano <gitster@pobox.com>2023-10-10 00:42:02 +0300
commite95bafc52f095b33b5a283179e08a44279c293d0 (patch)
tree7ca13bb2c7fa80f96a82f7dc7b68cc08d8034ffd /merge-ort.c
parentfb7d80edcae482f4fa5d4be0227dc3054734e5f3 (diff)
merge-ort: initialize repo in index state
initialize_attr_index() does not initialize the repo member of attr_index. Starting in 44451a2e5e (attr: teach "--attr-source=<tree>" global option to "git", 2023-05-06), this became a problem because istate->repo gets passed down the call chain starting in git_check_attr(). This gets passed all the way down to replace_refs_enabled(), which segfaults when accessing r->gitdir. Fix this by initializing the repository in the index state. Signed-off-by: John Cai <johncai86@gmail.com> Helped-by: Christian Couder <christian.couder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'merge-ort.c')
-rw-r--r--merge-ort.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/merge-ort.c b/merge-ort.c
index a50b095c47..44782c19cb 100644
--- a/merge-ort.c
+++ b/merge-ort.c
@@ -1916,6 +1916,7 @@ static void initialize_attr_index(struct merge_options *opt)
struct index_state *attr_index = &opt->priv->attr_index;
struct cache_entry *ce;
+ attr_index->repo = opt->repo;
attr_index->initialized = 1;
if (!opt->renormalize)