From: Junio C Hamano Date: Mon, 2 May 2011 22:58:30 +0000 (-0700) Subject: Merge branch 'nd/maint-setup' X-Git-Tag: v1.7.6-rc0~126 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=c67e367c50304c5a0701ae2bb8ecb7291f481ffd;p=git.git Merge branch 'nd/maint-setup' * nd/maint-setup: Kill off get_relative_cwd() setup: return correct prefix if worktree is '/' Conflicts: dir.c setup.c --- c67e367c50304c5a0701ae2bb8ecb7291f481ffd diff --cc setup.c index 03cd84f2f,f0468c686..b6e6b5ae2 --- a/setup.c +++ b/setup.c @@@ -390,9 -388,9 +391,9 @@@ static const char *setup_explicit_git_d return NULL; } - if (!prefixcmp(cwd, worktree) && - cwd[strlen(worktree)] == '/') { /* cwd inside worktree */ + offset = dir_inside_of(cwd, worktree); + if (offset >= 0) { /* cwd inside worktree? */ - set_git_dir(make_absolute_path(gitdirenv)); + set_git_dir(real_path(gitdirenv)); if (chdir(worktree)) die_errno("Could not chdir to '%s'", worktree); cwd[len++] = '/';