t4018-diff-funcname: test syntax of builtin xfuncname patterns
[gitweb.git] / setup.c
diff --git a/setup.c b/setup.c
index 6cf909463d4ad3681a2f35269db9dc944f4389c2..2e3248a0c4958f31001213470a88d1154b5947fc 100644 (file)
--- a/setup.c
+++ b/setup.c
@@ -581,6 +581,8 @@ const char *setup_git_directory(void)
                if (retval && chdir(retval))
                        die ("Could not jump back into original cwd");
                rel = get_relative_cwd(buffer, PATH_MAX, get_git_work_tree());
+               if (rel && *rel && chdir(get_git_work_tree()))
+                       die ("Could not jump to working directory");
                return rel && *rel ? strcat(rel, "/") : NULL;
        }