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