]> git.ipfire.org Git - thirdparty/git.git/blame - t/t2105-update-index-gitfile.sh
The third batch
[thirdparty/git.git] / t / t2105-update-index-gitfile.sh
CommitLineData
48cc95ed
BK
1#!/bin/sh
2#
3# Copyright (c) 2010 Brad King
4#
5
6test_description='git update-index for gitlink to .git file.
7'
8
977e458c 9TEST_PASSES_SANITIZE_LEAK=true
48cc95ed
BK
10. ./test-lib.sh
11
12test_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
22test_expect_success 'add gitlink to absolute .git file' '
23 git update-index --add -- sub1
24'
25
26test_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 35test_expect_success 'add gitlink to relative .git file' '
48cc95ed
BK
36 git update-index --add -- sub2
37'
38
39test_done