Fix --exclude-ignore option.

This fixes https://savannah.gnu.org/bugs/?64387.

* src/exclist.c (info_attach_exclist): Always use file->flags.
(exclude_vcs_ignores): Pass flags from struct vcs_ignore_file
to excfile_add.

* tests/exclude19.at: New test.
* tests/exclude20.at: New test.
* tests/Makefile.am: Add new tests.
* tests/testsuite.at: Add new tests.
This commit is contained in:
Sergey Poznyakoff
2024-01-15 21:24:34 +02:00
parent d763055edd
commit f622c07108
6 changed files with 97 additions and 4 deletions
+2 -3
View File
@@ -118,8 +118,7 @@ info_attach_exclist (struct tar_stat_info *dir)
ent = xmalloc (sizeof (*ent));
ent->excluded = ex;
ent->flags = file->flags == EXCL_DEFAULT
? file->flags : vcsfile->flags;
ent->flags = file->flags;
ent->prev = tail;
ent->next = NULL;
@@ -333,5 +332,5 @@ exclude_vcs_ignores (void)
struct vcs_ignore_file *p;
for (p = vcs_ignore_files; p->filename; p++)
excfile_add (p->filename, EXCL_DEFAULT);
excfile_add (p->filename, p->flags);
}