diff options
-rw-r--r-- | setup.c | 2 | ||||
-rwxr-xr-x | t/t4111-apply-subdir.sh | 2 |
2 files changed, 3 insertions, 1 deletions
@@ -369,6 +369,8 @@ static const char *setup_bare_git_dir(const char *work_tree_env, if (!work_tree_env) inside_work_tree = 0; if (offset != len) { + if (chdir(cwd)) + die_errno("Cannot come back to cwd"); root_len = offset_1st_component(cwd); cwd[offset > root_len ? offset : root_len] = '\0'; set_git_dir(cwd); diff --git a/t/t4111-apply-subdir.sh b/t/t4111-apply-subdir.sh index d6271ae34b..a52d94ae21 100755 --- a/t/t4111-apply-subdir.sh +++ b/t/t4111-apply-subdir.sh @@ -97,7 +97,7 @@ test_expect_success 'apply from .git dir' ' test_cmp expected .git/file ' -test_expect_failure 'apply from subdir of .git dir' ' +test_expect_success 'apply from subdir of .git dir' ' cp postimage expected && cp preimage .git/file && cp preimage .git/objects/file |