extend gitAnnexLink special case for worktrees
Fix symlinks generated to annexed content when in adjusted unlocked branch in a linked worktree on a filesystem not supporting symlinks. Before this fix, the symlink generated by eg git-annex sync in an adjusted unlocked branch contained ".git/worktrees/". There was a special case for the similar problem with submodules, so just use it to handle this case as well. To detect this case, rely on fixupUnusualRepos setting mainWorkTreePath.
This commit is contained in:
parent
9cdcbedf2d
commit
aded5f9b7f
2 changed files with 6 additions and 4 deletions
|
@ -270,10 +270,10 @@ gitAnnexLink file key r config = do
|
||||||
toInternalGitPath <$> relPathDirToFile (parentDir absfile) loc
|
toInternalGitPath <$> relPathDirToFile (parentDir absfile) loc
|
||||||
where
|
where
|
||||||
getgitdir currdir
|
getgitdir currdir
|
||||||
{- This special case is for git submodules on filesystems not
|
{- This special case is for git submodules and worktrees
|
||||||
- supporting symlinks; generate link target that will
|
- on filesystems not supporting symlinks; generate link
|
||||||
- work portably. -}
|
- target that will work portably. -}
|
||||||
| not (coreSymlinks config) && needsSubmoduleFixup r =
|
| not (coreSymlinks config) && (needsSubmoduleFixup r || isJust (Git.mainWorkTreePath r)) =
|
||||||
absNormPathUnix currdir (Git.repoPath r </> literalOsPath ".git")
|
absNormPathUnix currdir (Git.repoPath r </> literalOsPath ".git")
|
||||||
| otherwise = Git.localGitDir r
|
| otherwise = Git.localGitDir r
|
||||||
absNormPathUnix d p = toInternalGitPath $
|
absNormPathUnix d p = toInternalGitPath $
|
||||||
|
|
|
@ -6,6 +6,8 @@ git-annex (10.20250631) UNRELEASED; urgency=medium
|
||||||
symlinks, that caused annexed file content to be stored in the wrong
|
symlinks, that caused annexed file content to be stored in the wrong
|
||||||
location inside the git directory, and also caused pointer files to not
|
location inside the git directory, and also caused pointer files to not
|
||||||
get populated.
|
get populated.
|
||||||
|
* Fix symlinks generated to annexed content when in adjusted unlocked
|
||||||
|
branch in a linked worktree on a filesystem not supporting symlinks.
|
||||||
|
|
||||||
-- Joey Hess <id@joeyh.name> Mon, 07 Jul 2025 15:59:42 -0400
|
-- Joey Hess <id@joeyh.name> Mon, 07 Jul 2025 15:59:42 -0400
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue