summaryrefslogtreecommitdiff
path: root/setup.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-10-28 10:42:29 -0700
committerJunio C Hamano <gitster@pobox.com>2013-10-28 10:42:30 -0700
commite22c1c7f19914aa0dc1b6fe65bbfafed265d6e7f (patch)
treecc9fe2c10ec884cf474443bca6ac511065c95432 /setup.c
parent3d092bfc6f2d9a998967979f926c661e9762601c (diff)
parent41894ae3a315f75ebc924881c6ce9a69d70ce9c0 (diff)
downloadgit-e22c1c7f19914aa0dc1b6fe65bbfafed265d6e7f.tar.gz
Merge branch 'jx/relative-path-regression-fix'
* jx/relative-path-regression-fix: Use simpler relative_path when set_git_dir relative_path should honor dos-drive-prefix test: use unambigous leading path (/foo) for MSYS
Diffstat (limited to 'setup.c')
-rw-r--r--setup.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/setup.c b/setup.c
index f08dd64976..dbf4138720 100644
--- a/setup.c
+++ b/setup.c
@@ -227,7 +227,6 @@ int is_inside_work_tree(void)
void setup_work_tree(void)
{
- struct strbuf sb = STRBUF_INIT;
const char *work_tree, *git_dir;
static int initialized = 0;
@@ -247,10 +246,8 @@ void setup_work_tree(void)
if (getenv(GIT_WORK_TREE_ENVIRONMENT))
setenv(GIT_WORK_TREE_ENVIRONMENT, ".", 1);
- set_git_dir(relative_path(git_dir, work_tree, &sb));
+ set_git_dir(remove_leading_path(git_dir, work_tree));
initialized = 1;
-
- strbuf_release(&sb);
}
static int check_repository_format_gently(const char *gitdir, int *nongit_ok)