4
0

exclude18.at 1.9 KB

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