Merge branch 'es/worktree-repair-copied' into cw/worktrees-relative
[git/gitster.git] / t / t2105-update-index-gitfile.sh
blob963ebe77eb6b49b733f249b4ee93020b35ca4097
1 #!/bin/sh
3 # Copyright (c) 2010 Brad King
6 test_description='git update-index for gitlink to .git file.
9 TEST_PASSES_SANITIZE_LEAK=true
10 . ./test-lib.sh
12 test_expect_success 'submodule with absolute .git file' '
13 mkdir sub1 &&
14 (cd sub1 &&
15 git init &&
16 REAL="$(pwd)/.real" &&
17 mv .git "$REAL" &&
18 echo "gitdir: $REAL" >.git &&
19 test_commit first)
22 test_expect_success 'add gitlink to absolute .git file' '
23 git update-index --add -- sub1
26 test_expect_success 'submodule with relative .git file' '
27 mkdir sub2 &&
28 (cd sub2 &&
29 git init &&
30 mv .git .real &&
31 echo "gitdir: .real" >.git &&
32 test_commit first)
35 test_expect_success 'add gitlink to relative .git file' '
36 git update-index --add -- sub2
39 test_done