pr-2205/yoichi/worktree-repair-relative-path-handling-v3
tagged this
21 Aug 20:36
From: Yoichi NAKAYAMA <yoichi.nakayama@gmail.com> Given a state in which the cross-references between the worktree and the repository (specifically worktree/id/gitdir in the main repository and the .git file in the worktree) are recorded using absolute paths, setting 'worktree.useRelativePaths=true' and running 'git worktree repair' within the main worktree converts them to relative paths. Conversely, given a state in which the cross-references are recorded using relative paths, one would expect that setting 'worktree.useRelativePaths=false' and running 'git worktree repair' would convert them to absolute paths. However, they remain as relative paths. This is because we incorrectly use read_gitfile_gently(), which always returns an absolute path. To fix this, introduce read_gitfile_raw(), which is almost identical to read_gitfile_gently(), but skips checking the existence of the referenced repository and returns the path as-is from the .git file. Signed-off-by: Yoichi NAKAYAMA <yoichi.nakayama@gmail.com> Submitted-As: https://lore.kernel.org/git/pull.2205.v3.git.1787344586470.gitgitgadget@gmail.com In-Reply-To: https://lore.kernel.org/git/pull.2205.git.1786799480344.gitgitgadget@gmail.com In-Reply-To: https://lore.kernel.org/git/pull.2205.v2.git.1787240760069.gitgitgadget@gmail.com