summaryrefslogtreecommitdiff
path: root/t/t1501-work-tree.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-04-25 04:28:52 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-04-25 04:28:52 (GMT)
commitff6eb825f0aa1f45230c10fbb0cf8d484c927c55 (patch)
treee64f3f038b0f888c0ddc0a5c97e0d266068b82a4 /t/t1501-work-tree.sh
parent5d8da91e707668227464c9ba0e74b5fea1ee3b7e (diff)
parentfb9c2d27039a23457cb9710d86e00c51dfb910dc (diff)
downloadgit-ff6eb825f0aa1f45230c10fbb0cf8d484c927c55.zip
git-ff6eb825f0aa1f45230c10fbb0cf8d484c927c55.tar.gz
git-ff6eb825f0aa1f45230c10fbb0cf8d484c927c55.tar.bz2
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
Diffstat (limited to 't/t1501-work-tree.sh')
-rwxr-xr-xt/t1501-work-tree.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/t/t1501-work-tree.sh b/t/t1501-work-tree.sh
index 02cf201..9c0bc65 100755
--- a/t/t1501-work-tree.sh
+++ b/t/t1501-work-tree.sh
@@ -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