Files
git/builtin
Derrick Stolee b56166ca57 multi-pack-index: use --object-dir real path
The --object-dir argument to 'git multi-pack-index' allows a user to
specify an alternate to use instead of the local $GITDIR. This is used
by third-party tools like VFS for Git to maintain the pack-files in a
"shared object cache" used by multiple clones.

On Windows, the user can specify a path using a Windows-style file path
with backslashes such as "C:\Path\To\ObjectDir". This same path style is
used in the .git/objects/info/alternates file, so it already matches the
path of that alternate. However, find_odb() converts these paths to
real-paths for the comparison, which use forward slashes. As of the
previous change, lookup_multi_pack_index() uses real-paths, so it
correctly finds the target multi-pack-index when given these paths.

Some commands such as 'git multi-pack-index repack' call child processes
using the object_dir value, so it can be helpful to convert the path to
the real-path before sending it to those locations.

Add a callback to convert the real path immediately upon parsing the
argument. We need to be careful that we don't store the exact value out
of get_object_directory() and free it, or we could corrupt a later use
of the_repository->objects->odb->path.

We don't use get_object_directory() for the initial instantiation in
cmd_multi_pack_index() because we need 'git multi-pack-index -h' to work
without a Git repository.

Signed-off-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-04-25 11:31:12 -07:00
..
2022-01-10 11:52:56 -08:00
2021-12-21 15:03:17 -08:00
2022-01-12 15:11:43 -08:00
2021-10-28 09:57:09 -07:00
2021-12-06 09:55:06 -08:00
2022-01-12 15:11:43 -08:00
2021-10-23 10:45:25 -07:00
2022-01-10 11:52:56 -08:00
2021-09-28 10:31:02 -07:00
2022-01-10 11:52:53 -08:00
2022-01-03 16:24:15 -08:00
2021-12-22 11:42:39 -08:00
2022-01-03 16:24:15 -08:00
2022-01-10 11:52:56 -08:00
2022-01-28 16:45:52 -08:00
2022-01-05 13:31:00 -08:00
2021-11-03 13:25:36 -07:00