Skip to content

pr-git-1719/trws/honor-prefix-v1

From: Tom Scogland <scogland1@llnl.gov>

The documentation for archive states:

  The path of the file in the archive is built by concatenating the
  value of the last `--prefix` moption (if any) before this
  `--add-virtual-file` and <path>.

This matches the documentation for --add-file and the behavior works for
that option, but --prefix is ignored for --add-virtual-file.

This commit modifies archive.c to include the prefix in the path and
adds a check into the existing add-virtual-file test to ensure that it
honors both the most recent prefix before the flag.

In looking for others with this issue, I found message
a143e25a70b44b82b4ee6fa3bb2bcda4@atlas-elektronik.com on the mailing
list, where Stefan proposed a basically identical patch to archive.c
back in February, so the main addition here is the test along with that
patch.

Signed-off-by: Tom Scogland <scogland1@llnl.gov>

Submitted-As: https://lore.kernel.org/git/pull.1719.git.git.1715721327429.gitgitgadget@gmail.com
Assets 2