]> git.ipfire.org Git - thirdparty/git.git/commit
merge-ort: initialize repo in index state
authorJohn Cai <johncai86@gmail.com>
Mon, 9 Oct 2023 13:21:00 +0000 (13:21 +0000)
committerJunio C Hamano <gitster@pobox.com>
Mon, 9 Oct 2023 21:42:02 +0000 (14:42 -0700)
commite95bafc52f095b33b5a283179e08a44279c293d0
tree7ca13bb2c7fa80f96a82f7dc7b68cc08d8034ffd
parentfb7d80edcae482f4fa5d4be0227dc3054734e5f3
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>
merge-ort.c
t/t4300-merge-tree.sh