3 # Copyright (c) 2012 Daniel Graña
6 test_description
='Test submodules on detached working tree
8 This test verifies that "git submodule" initialization, update and addition works
9 on detahced working trees
15 test_expect_success
'submodule on detached working tree' '
16 git init --bare remote &&
17 test_create_repo bundle1 &&
18 (cd bundle1 && test_commit "shoot") &&
22 export GIT_WORK_TREE="$(pwd)" GIT_DIR="$(pwd)/.dotfiles" &&
23 git clone --bare ../remote .dotfiles &&
24 git submodule add ../bundle1 .vim/bundle/sogood &&
25 test_commit "sogood" &&
26 git push origin master
31 export GIT_WORK_TREE="$(pwd)" GIT_DIR="$(pwd)/.dotfiles" &&
32 git clone --bare ../remote .dotfiles &&
33 git submodule update --init
37 test_expect_success
'submodule on detached working pointed by core.worktree' '
41 export GIT_DIR="$(pwd)/.dotfiles" &&
42 git clone --bare ../remote "$GIT_DIR" &&
43 git config core.bare false &&
44 git config core.worktree .. &&
45 git submodule add ../bundle1 .vim/bundle/dupe &&
47 git push origin master
51 export GIT_DIR="$(pwd)/.dotfiles" &&
52 git config core.bare false &&
53 git config core.worktree .. &&
55 git submodule update &&
56 git submodule status &&
57 test -d .vim/bundle/dupe