]> git.ipfire.org Git - thirdparty/git.git/blob - t/t2105-update-index-gitfile.sh
t2104: style fixes
[thirdparty/git.git] / t / t2105-update-index-gitfile.sh
1 #!/bin/sh
2 #
3 # Copyright (c) 2010 Brad King
4 #
5
6 test_description='git update-index for gitlink to .git file.
7 '
8
9 TEST_PASSES_SANITIZE_LEAK=true
10 . ./test-lib.sh
11
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)
20 '
21
22 test_expect_success 'add gitlink to absolute .git file' '
23 git update-index --add -- sub1
24 '
25
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)
33 '
34
35 test_expect_success 'add gitlink to relative .git file' '
36 git update-index --add -- sub2
37 '
38
39 test_done