]> git.ipfire.org Git - thirdparty/git.git/blame - t/t7515-status-symlinks.sh
Start the 2.46 cycle
[thirdparty/git.git] / t / t7515-status-symlinks.sh
CommitLineData
ccad42d4
RS
1#!/bin/sh
2
3test_description='git status and symlinks'
4
94882d12 5TEST_PASSES_SANITIZE_LEAK=true
ccad42d4
RS
6. ./test-lib.sh
7
8test_expect_success 'setup' '
9 echo .gitignore >.gitignore &&
10 echo actual >>.gitignore &&
11 echo expect >>.gitignore &&
12 mkdir dir &&
13 echo x >dir/file1 &&
14 echo y >dir/file2 &&
15 git add dir &&
16 git commit -m initial &&
17 git tag initial
18'
19
20test_expect_success SYMLINKS 'symlink to a directory' '
21 test_when_finished "rm symlink" &&
22 ln -s dir symlink &&
23 echo "?? symlink" >expect &&
24 git status --porcelain >actual &&
25 test_cmp expect actual
26'
27
28test_expect_success SYMLINKS 'symlink replacing a directory' '
29 test_when_finished "rm -rf copy && git reset --hard initial" &&
30 mkdir copy &&
31 cp dir/file1 copy/file1 &&
32 echo "changed in copy" >copy/file2 &&
33 git add copy &&
34 git commit -m second &&
35 rm -rf copy &&
36 ln -s dir copy &&
37 echo " D copy/file1" >expect &&
38 echo " D copy/file2" >>expect &&
39 echo "?? copy" >>expect &&
40 git status --porcelain >actual &&
41 test_cmp expect actual
42'
43
44test_done