t: add missing executable bit to t7409
[git/jnareb-git.git] / t / t7409-submodule-detached-worktree.sh
blobdb75642fc37c89fb4a9c3096cb194c8872d14f01
1 #!/bin/sh
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
12 TEST_NO_CREATE_REPO=1
13 . ./test-lib.sh
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") &&
19 mkdir home &&
21 cd home &&
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
27 ) &&
28 mkdir home2 &&
30 cd home2 &&
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' '
38 mkdir home3 &&
40 cd home3 &&
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 &&
46 test_commit "dupe" &&
47 git push origin master
48 ) &&
50 cd home &&
51 export GIT_DIR="$(pwd)/.dotfiles" &&
52 git config core.bare false &&
53 git config core.worktree .. &&
54 git pull &&
55 git submodule update &&
56 git submodule status &&
57 test -d .vim/bundle/dupe
61 test_done