summaryrefslogtreecommitdiff
path: root/setup.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2018-03-30 18:35:12 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-03-30 19:50:03 (GMT)
commitfb9c2d27039a23457cb9710d86e00c51dfb910dc (patch)
treeb5a6eb64aaea881017bdf5e935f6accc42c21b8d /setup.c
parent8500e0de3fe2e33ba503d432a4a5301ce2fb60fa (diff)
downloadgit-fb9c2d27039a23457cb9710d86e00c51dfb910dc.zip
git-fb9c2d27039a23457cb9710d86e00c51dfb910dc.tar.gz
git-fb9c2d27039a23457cb9710d86e00c51dfb910dc.tar.bz2
refs: use chdir_notify to update cached relative paths
Commit f57f37e2e1 (files-backend: remove the use of git_path(), 2017-03-26) introduced a regression when a relative $GIT_DIR is used in a working tree: - when we initialize the ref backend, we make a copy of get_git_dir(), which may be relative - later, we may call setup_work_tree() and chdir to the root of the working tree - further calls to the ref code will use the stored git directory, but relative paths will now point to the wrong place The new test in t1501 demonstrates one such instance (the bug causes us to write the ref update to the nonsense "relative/relative/.git"). Since setup_work_tree() now uses chdir_notify, we can just ask it update our relative paths when necessary. Reported-by: Rafael Ascensao <rafa.almas@gmail.com> Helped-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'setup.c')
0 files changed, 0 insertions, 0 deletions