summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2016-10-03 13:30:34 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2016-10-03 13:30:35 -0700
commit53eb85e6230e2c09dbc06f88b67e7a3baccc4446 (patch)
tree6290667f96d15d82b964e5f9ed9db906e8fca616 /t
parentMerge branch 'ik/gitweb-force-highlight' (diff)
parentinit: kill git_link variable (diff)
downloadtgif-53eb85e6230e2c09dbc06f88b67e7a3baccc4446.tar.xz
Merge branch 'nd/init-core-worktree-in-multi-worktree-world'
"git init" tried to record core.worktree in the repository's 'config' file when GIT_WORK_TREE environment variable was set and it was different from where GIT_DIR appears as ".git" at its top, but the logic was faulty when .git is a "gitdir:" file that points at the real place, causing trouble in working trees that are managed by "git worktree". This has been corrected. * nd/init-core-worktree-in-multi-worktree-world: init: kill git_link variable init: do not set unnecessary core.worktree init: kill set_git_dir_init() init: call set_git_dir_init() from within init_db() init: correct re-initialization from a linked worktree
Diffstat (limited to 't')
-rwxr-xr-xt/t0001-init.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/t/t0001-init.sh b/t/t0001-init.sh
index 8ffbbea4d6..b8fc588b19 100755
--- a/t/t0001-init.sh
+++ b/t/t0001-init.sh
@@ -393,4 +393,21 @@ test_expect_success 'remote init from does not use config from cwd' '
test_cmp expect actual
'
+test_expect_success 're-init from a linked worktree' '
+ git init main-worktree &&
+ (
+ cd main-worktree &&
+ test_commit first &&
+ git worktree add ../linked-worktree &&
+ mv .git/info/exclude expected-exclude &&
+ cp .git/config expected-config &&
+ find .git/worktrees -print | sort >expected &&
+ git -C ../linked-worktree init &&
+ test_cmp expected-exclude .git/info/exclude &&
+ test_cmp expected-config .git/config &&
+ find .git/worktrees -print | sort >actual &&
+ test_cmp expected actual
+ )
+'
+
test_done