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

@@ -150,6 +150,7 @@ struct repository {
/* Configurations */
int repository_format_worktree_config;
int repository_format_relative_worktrees;
/* Indicate if a repository has a different 'commondir' from 'gitdir' */
unsigned different_commondir:1;