Debian Codegraph @

tests/exclude18.at

raw ◀ ▶
1 Debian patch touch this file
•1 # Process this file with autom4te to create testsuite. -*- Autotest -*-
2
3 # Test suite for GNU tar.
4 # Copyright 2004-2023 Free Software Foundation, Inc.
5
6 # This file is part of GNU tar.
7
8 # GNU tar is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 3 of the License, or
11 # (at your option) any later version.
12
13 # GNU tar is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
17
18 # You should have received a copy of the GNU General Public License
19 # along with this program. If not, see <http://www.gnu.org/licenses/>.
20
21 # Test --exclude-vcs option with subcommands: EXTRACT, LIST, DIFF.
22 # Check VCS directory with files, and empty.
23 #
24 # Ref: https://savannah.gnu.org/bugs/?62859
25 # Wed 03 Aug 2022 04:06:28 PM UTC, original submission: Quote
26 # Mohamed Akram <mohdakram>
27 # > The --exclude-vcs flag seems to exclude .gitignore but not .git when
28 # extracting.
29
30 AT_SETUP([--exclude-vcs extract list compare])
31 AT_KEYWORDS([exclude-vcs extract list compare exclude18])
32
33 AT_TAR_CHECK([
34 AT_SORT_PREREQ
35 mkdir gitrepo
36 cd gitrepo
37
38 # Make an empty VCS directory:
39 mkdir .svn
40
41 # Make a VCS directory with a file:
42 mkdir .git
43 touch .git/_A
44
45 # Make a VCS file:
46 touch .gitignore
47
48 # Make non-VCS files:
49 touch .git_B
50 touch _C
51
52 # Create an archive, include VCS:
53 cd ..
54 tar -cf gitrepo.tar gitrepo
55 rm -r gitrepo
56
57 echo Extract:
58 tar -xvf gitrepo.tar --exclude-vcs | sort
59
60 echo
61 echo List:
62 tar -tf gitrepo.tar --exclude-vcs | sort
63
64 echo
65 echo Diff:
66 tar -dvf gitrepo.tar --exclude-vcs gitrepo | sort
67
68 ],
69 [0],
70 [Extract:
71 gitrepo/
72 gitrepo/.git_B
73 gitrepo/_C
74
75 List:
76 gitrepo/
77 gitrepo/.git_B
78 gitrepo/_C
79
80 Diff:
81 gitrepo/
82 gitrepo/.git_B
83 gitrepo/_C
84 ],
85 [])
86
87 AT_CLEANUP