Brad King | 48cc95e | 2010-01-08 22:36:40 -0500 | [diff] [blame] | 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-lib.sh |
| 10 | |
| 11 | test_expect_success 'submodule with absolute .git file' ' |
| 12 | mkdir sub1 && |
| 13 | (cd sub1 && |
| 14 | git init && |
| 15 | REAL="$(pwd)/.real" && |
Jonathan Nieder | 76bbcd4 | 2010-09-06 20:49:10 -0500 | [diff] [blame] | 16 | mv .git "$REAL" && |
Brad King | 48cc95e | 2010-01-08 22:36:40 -0500 | [diff] [blame] | 17 | echo "gitdir: $REAL" >.git && |
| 18 | test_commit first) |
| 19 | ' |
| 20 | |
| 21 | test_expect_success 'add gitlink to absolute .git file' ' |
| 22 | git update-index --add -- sub1 |
| 23 | ' |
| 24 | |
| 25 | test_expect_success 'submodule with relative .git file' ' |
| 26 | mkdir sub2 && |
| 27 | (cd sub2 && |
| 28 | git init && |
| 29 | mv .git .real && |
| 30 | echo "gitdir: .real" >.git && |
| 31 | test_commit first) |
| 32 | ' |
| 33 | |
Brad King | 40c813e | 2010-01-08 22:36:41 -0500 | [diff] [blame] | 34 | test_expect_success 'add gitlink to relative .git file' ' |
Brad King | 48cc95e | 2010-01-08 22:36:40 -0500 | [diff] [blame] | 35 | git update-index --add -- sub2 |
| 36 | ' |
| 37 | |
| 38 | test_done |