summaryrefslogtreecommitdiff
path: root/t/helper/test-xml-encode.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2023-03-28 16:54:13 -0400
committerJunio C Hamano <gitster@pobox.com>2023-03-28 14:11:24 -0700
commit9dc607f1c29de88bc5194df49cc7f834e528a3e9 (patch)
treecaa0023398a0667e97a59119e35feafc1546fcc5 /t/helper/test-xml-encode.c
parent8d90352acc5c855620042fdcc6092f23a276af6d (diff)
fast-import: fix file access when run from subdir
In cmd_fast_import(), we ignore the "prefix" argument entirely, even though it tells us how we may have changed directory to the root of the repository earlier in the process. Which means that if you run it from a subdir and point to paths in the filesystem, like: cd subdir git fast-import --import-marks=foo <dump then it will look for "foo" in the root of the repository, not the current directory ("subdir/") which the user would have expected. We can fix this by recording the prefix and using it as appropriate whenever we open a file for reading or writing. I found each of these by looking for cases where we call fopen() within fast-import.c, so this should cover all cases. The new test triggers each one, as well as making sure we don't accidentally apply the prefix when --relative-marks is in use (since that option interprets some paths as relative to a specific directory). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/helper/test-xml-encode.c')
0 files changed, 0 insertions, 0 deletions