worktree: add relativeWorktrees extension

A new extension, `relativeWorktrees`, is added to indicate that at least
one worktree in the repository has been linked with relative paths.
This ensures older Git versions do not attempt to automatically prune
worktrees with relative paths, as they would not not recognize the
paths as being valid.

Suggested-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Caleb White <cdwhite3@pm.me>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Caleb White
2024-11-29 22:22:34 +00:00
committed by Junio C Hamano
parent d897f2c16d
commit 1860ba1a2a
5 changed files with 16 additions and 0 deletions

View File

@ -283,6 +283,7 @@ int repo_init(struct repository *repo,
repo_set_compat_hash_algo(repo, format.compat_hash_algo);
repo_set_ref_storage_format(repo, format.ref_storage_format);
repo->repository_format_worktree_config = format.worktree_config;
repo->repository_format_relative_worktrees = format.relative_worktrees;
/* take ownership of format.partial_clone */
repo->repository_format_partial_clone = format.partial_clone;