]> git.ipfire.org Git - thirdparty/git.git/blame - t/t5002-archive-attr-pattern.sh
leak tests: mark some misc tests as passing with SANITIZE=leak
[thirdparty/git.git] / t / t5002-archive-attr-pattern.sh
CommitLineData
94bc671a
JNA
1#!/bin/sh
2
3test_description='git archive attribute pattern tests'
4
d96fb140 5TEST_PASSES_SANITIZE_LEAK=true
94bc671a
JNA
6. ./test-lib.sh
7
8test_expect_exists() {
9 test_expect_success " $1 exists" "test -e $1"
10}
11
12test_expect_missing() {
13 test_expect_success " $1 does not exist" "test ! -e $1"
14}
15
16test_expect_success 'setup' '
17 echo ignored >ignored &&
18 echo ignored export-ignore >>.git/info/attributes &&
19 git add ignored &&
20
21 mkdir not-ignored-dir &&
22 echo ignored-in-tree >not-ignored-dir/ignored &&
23 echo not-ignored-in-tree >not-ignored-dir/ignored-only-if-dir &&
24 git add not-ignored-dir &&
25
26 mkdir ignored-only-if-dir &&
27 echo ignored by ignored dir >ignored-only-if-dir/ignored-by-ignored-dir &&
28 echo ignored-only-if-dir/ export-ignore >>.git/info/attributes &&
29 git add ignored-only-if-dir &&
30
efa5f825
JK
31 mkdir -p ignored-without-slash &&
32 echo "ignored without slash" >ignored-without-slash/foo &&
33 git add ignored-without-slash/foo &&
34 echo "ignored-without-slash export-ignore" >>.git/info/attributes &&
35
36 mkdir -p wildcard-without-slash &&
37 echo "ignored without slash" >wildcard-without-slash/foo &&
38 git add wildcard-without-slash/foo &&
39 echo "wild*-without-slash export-ignore" >>.git/info/attributes &&
40
41 mkdir -p deep/and/slashless &&
42 echo "ignored without slash" >deep/and/slashless/foo &&
43 git add deep/and/slashless/foo &&
44 echo "deep/and/slashless export-ignore" >>.git/info/attributes &&
45
46 mkdir -p deep/with/wildcard &&
47 echo "ignored without slash" >deep/with/wildcard/foo &&
48 git add deep/with/wildcard/foo &&
49 echo "deep/*t*/wildcard export-ignore" >>.git/info/attributes &&
94bc671a
JNA
50
51 mkdir -p one-level-lower/two-levels-lower/ignored-only-if-dir &&
52 echo ignored by ignored dir >one-level-lower/two-levels-lower/ignored-only-if-dir/ignored-by-ignored-dir &&
53 git add one-level-lower &&
54
55 git commit -m. &&
56
57 git clone --bare . bare &&
58 cp .git/info/attributes bare/info/attributes
59'
60
61test_expect_success 'git archive' '
62 git archive HEAD >archive.tar &&
63 (mkdir archive && cd archive && "$TAR" xf -) <archive.tar
64'
65
66test_expect_missing archive/ignored
67test_expect_missing archive/not-ignored-dir/ignored
68test_expect_exists archive/not-ignored-dir/ignored-only-if-dir
69test_expect_exists archive/not-ignored-dir/
70test_expect_missing archive/ignored-only-if-dir/
71test_expect_missing archive/ignored-ony-if-dir/ignored-by-ignored-dir
efa5f825
JK
72test_expect_missing archive/ignored-without-slash/ &&
73test_expect_missing archive/ignored-without-slash/foo &&
74test_expect_missing archive/wildcard-without-slash/
75test_expect_missing archive/wildcard-without-slash/foo &&
76test_expect_missing archive/deep/and/slashless/ &&
77test_expect_missing archive/deep/and/slashless/foo &&
78test_expect_missing archive/deep/with/wildcard/ &&
79test_expect_missing archive/deep/with/wildcard/foo &&
43180940 80test_expect_missing archive/one-level-lower/
94bc671a
JNA
81test_expect_missing archive/one-level-lower/two-levels-lower/ignored-only-if-dir/
82test_expect_missing archive/one-level-lower/two-levels-lower/ignored-ony-if-dir/ignored-by-ignored-dir
83
84
85test_done