]> git.ipfire.org Git - thirdparty/git.git/blame - t/t0055-beyond-symlinks.sh
Start the 2.46 cycle
[thirdparty/git.git] / t / t0055-beyond-symlinks.sh
CommitLineData
806d13b1
JH
1#!/bin/sh
2
725b0605 3test_description='update-index and add refuse to add beyond symlinks'
806d13b1 4
c150064d 5TEST_PASSES_SANITIZE_LEAK=true
806d13b1
JH
6. ./test-lib.sh
7
704a3143 8test_expect_success SYMLINKS setup '
806d13b1
JH
9 >a &&
10 mkdir b &&
11 ln -s b c &&
12 >c/d &&
13 git update-index --add a b/d
14'
15
704a3143 16test_expect_success SYMLINKS 'update-index --add beyond symlinks' '
806d13b1 17 test_must_fail git update-index --add c/d &&
c7e03b4e
ÆAB
18 cat >expect <<-\EOF &&
19 a
20 b/d
21 EOF
22 git ls-files >actual &&
23 test_cmp expect actual
806d13b1
JH
24'
25
704a3143 26test_expect_success SYMLINKS 'add beyond symlinks' '
725b0605 27 test_must_fail git add c/d &&
c7e03b4e
ÆAB
28 cat >expect <<-\EOF &&
29 a
30 b/d
31 EOF
32 git ls-files >actual &&
33 test_cmp expect actual
725b0605
JH
34'
35
806d13b1 36test_done