Merge branch 'jk/relative-directory-fix'
Some codepaths, including the refs API, get and keep relative paths, that go out of sync when the process does chdir(2). The chdir-notify API is introduced to let these codepaths adjust these cached paths to the new current directory. * jk/relative-directory-fix: refs: use chdir_notify to update cached relative paths set_work_tree: use chdir_notify add chdir-notify API trace.c: export trace_setup_key set_git_dir: die when setenv() fails
This commit is contained in:
@ -431,4 +431,16 @@ test_expect_success 'error out gracefully on invalid $GIT_WORK_TREE' '
|
||||
)
|
||||
'
|
||||
|
||||
test_expect_success 'refs work with relative gitdir and work tree' '
|
||||
git init relative &&
|
||||
git -C relative commit --allow-empty -m one &&
|
||||
git -C relative commit --allow-empty -m two &&
|
||||
|
||||
GIT_DIR=relative/.git GIT_WORK_TREE=relative git reset HEAD^ &&
|
||||
|
||||
git -C relative log -1 --format=%s >actual &&
|
||||
echo one >expect &&
|
||||
test_cmp expect actual
|
||||
'
|
||||
|
||||
test_done
|
||||
|
Reference in New Issue
Block a user