]>
Commit | Line | Data |
---|---|---|
48cc95ed BK |
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 | ||
977e458c | 9 | TEST_PASSES_SANITIZE_LEAK=true |
48cc95ed BK |
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" && | |
76bbcd43 | 17 | mv .git "$REAL" && |
48cc95ed BK |
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 | ||
40c813e0 | 35 | test_expect_success 'add gitlink to relative .git file' ' |
48cc95ed BK |
36 | git update-index --add -- sub2 |
37 | ' | |
38 | ||
39 | test_done |