]>
Commit | Line | Data |
---|---|---|
94bc671a JNA |
1 | #!/bin/sh |
2 | ||
3 | test_description='git archive attribute pattern tests' | |
4 | ||
d96fb140 | 5 | TEST_PASSES_SANITIZE_LEAK=true |
8da0b02d | 6 | TEST_CREATE_REPO_NO_TEMPLATE=1 |
94bc671a JNA |
7 | . ./test-lib.sh |
8 | ||
9 | test_expect_exists() { | |
10 | test_expect_success " $1 exists" "test -e $1" | |
11 | } | |
12 | ||
13 | test_expect_missing() { | |
14 | test_expect_success " $1 does not exist" "test ! -e $1" | |
15 | } | |
16 | ||
17 | test_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 | ||
64 | test_expect_success 'git archive' ' | |
65 | git archive HEAD >archive.tar && | |
66 | (mkdir archive && cd archive && "$TAR" xf -) <archive.tar | |
67 | ' | |
68 | ||
69 | test_expect_missing archive/ignored | |
70 | test_expect_missing archive/not-ignored-dir/ignored | |
71 | test_expect_exists archive/not-ignored-dir/ignored-only-if-dir | |
72 | test_expect_exists archive/not-ignored-dir/ | |
73 | test_expect_missing archive/ignored-only-if-dir/ | |
74 | test_expect_missing archive/ignored-ony-if-dir/ignored-by-ignored-dir | |
efa5f825 JK |
75 | test_expect_missing archive/ignored-without-slash/ && |
76 | test_expect_missing archive/ignored-without-slash/foo && | |
77 | test_expect_missing archive/wildcard-without-slash/ | |
78 | test_expect_missing archive/wildcard-without-slash/foo && | |
79 | test_expect_missing archive/deep/and/slashless/ && | |
80 | test_expect_missing archive/deep/and/slashless/foo && | |
81 | test_expect_missing archive/deep/with/wildcard/ && | |
82 | test_expect_missing archive/deep/with/wildcard/foo && | |
43180940 | 83 | test_expect_missing archive/one-level-lower/ |
94bc671a JNA |
84 | test_expect_missing archive/one-level-lower/two-levels-lower/ignored-only-if-dir/ |
85 | test_expect_missing archive/one-level-lower/two-levels-lower/ignored-ony-if-dir/ignored-by-ignored-dir | |
86 | ||
87 | ||
88 | test_done |