remove objectDir'
This commit is contained in:
parent
f80ec74128
commit
95a04920cf
4 changed files with 9 additions and 13 deletions
|
@ -362,7 +362,7 @@ parseLinkTargetOrPointerLazy' b =
|
||||||
formatPointer :: Key -> S.ByteString
|
formatPointer :: Key -> S.ByteString
|
||||||
formatPointer k = prefix <> keyFile k <> nl
|
formatPointer k = prefix <> keyFile k <> nl
|
||||||
where
|
where
|
||||||
prefix = toInternalGitPath $ P.pathSeparator `S.cons` objectDir'
|
prefix = toInternalGitPath $ P.pathSeparator `S.cons` objectDir
|
||||||
nl = S8.singleton '\n'
|
nl = S8.singleton '\n'
|
||||||
|
|
||||||
{- Maximum size of a file that could be a pointer to a key.
|
{- Maximum size of a file that could be a pointer to a key.
|
||||||
|
@ -430,7 +430,7 @@ isLinkToAnnex s = p `S.isInfixOf` s
|
||||||
|| p' `S.isInfixOf` s
|
|| p' `S.isInfixOf` s
|
||||||
#endif
|
#endif
|
||||||
where
|
where
|
||||||
p = P.pathSeparator `S.cons` objectDir'
|
p = P.pathSeparator `S.cons` objectDir
|
||||||
#ifdef mingw32_HOST_OS
|
#ifdef mingw32_HOST_OS
|
||||||
p' = toInternalGitPath p
|
p' = toInternalGitPath p
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -14,7 +14,6 @@ module Annex.Locations (
|
||||||
keyPath,
|
keyPath,
|
||||||
annexDir,
|
annexDir,
|
||||||
objectDir,
|
objectDir,
|
||||||
objectDir',
|
|
||||||
gitAnnexLocation,
|
gitAnnexLocation,
|
||||||
gitAnnexLocation',
|
gitAnnexLocation',
|
||||||
gitAnnexLocationDepth,
|
gitAnnexLocationDepth,
|
||||||
|
@ -133,11 +132,8 @@ annexDir = P.addTrailingPathSeparator "annex"
|
||||||
|
|
||||||
{- The directory git annex uses for locally available object content,
|
{- The directory git annex uses for locally available object content,
|
||||||
- relative to the .git directory -}
|
- relative to the .git directory -}
|
||||||
objectDir :: FilePath
|
objectDir :: RawFilePath
|
||||||
objectDir = fromRawFilePath objectDir'
|
objectDir = P.addTrailingPathSeparator $ annexDir P.</> "objects"
|
||||||
|
|
||||||
objectDir' :: RawFilePath
|
|
||||||
objectDir' = P.addTrailingPathSeparator $ annexDir P.</> "objects"
|
|
||||||
|
|
||||||
{- Annexed file's possible locations relative to the .git directory
|
{- Annexed file's possible locations relative to the .git directory
|
||||||
- in a non-bare repository.
|
- in a non-bare repository.
|
||||||
|
@ -155,7 +151,7 @@ annexLocationsBare config key =
|
||||||
map (annexLocation config key) [hashDirLower, hashDirMixed]
|
map (annexLocation config key) [hashDirLower, hashDirMixed]
|
||||||
|
|
||||||
annexLocation :: GitConfig -> Key -> (HashLevels -> Hasher) -> RawFilePath
|
annexLocation :: GitConfig -> Key -> (HashLevels -> Hasher) -> RawFilePath
|
||||||
annexLocation config key hasher = objectDir' P.</> keyPath key (hasher $ objectHashLevels config)
|
annexLocation config key hasher = objectDir P.</> keyPath key (hasher $ objectHashLevels config)
|
||||||
|
|
||||||
{- Number of subdirectories from the gitAnnexObjectDir
|
{- Number of subdirectories from the gitAnnexObjectDir
|
||||||
- to the gitAnnexLocation. -}
|
- to the gitAnnexLocation. -}
|
||||||
|
@ -268,7 +264,7 @@ gitAnnexDir r = P.addTrailingPathSeparator $ Git.localGitDir r P.</> annexDir
|
||||||
{- The part of the annex directory where file contents are stored. -}
|
{- The part of the annex directory where file contents are stored. -}
|
||||||
gitAnnexObjectDir :: Git.Repo -> RawFilePath
|
gitAnnexObjectDir :: Git.Repo -> RawFilePath
|
||||||
gitAnnexObjectDir r = P.addTrailingPathSeparator $
|
gitAnnexObjectDir r = P.addTrailingPathSeparator $
|
||||||
Git.localGitDir r P.</> objectDir'
|
Git.localGitDir r P.</> objectDir
|
||||||
|
|
||||||
{- .git/annex/tmp/ is used for temp files for key's contents -}
|
{- .git/annex/tmp/ is used for temp files for key's contents -}
|
||||||
gitAnnexTmpObjectDir :: Git.Repo -> RawFilePath
|
gitAnnexTmpObjectDir :: Git.Repo -> RawFilePath
|
||||||
|
|
|
@ -337,7 +337,7 @@ reconcileStaged qh = unlessM (Git.Config.isBare <$> gitRepo) $ do
|
||||||
-- a non-pointer file will match this. This is only a
|
-- a non-pointer file will match this. This is only a
|
||||||
-- prefilter so that's ok.
|
-- prefilter so that's ok.
|
||||||
, Param $ "-G" ++ fromRawFilePath (toInternalGitPath $
|
, Param $ "-G" ++ fromRawFilePath (toInternalGitPath $
|
||||||
P.pathSeparator `S.cons` objectDir')
|
P.pathSeparator `S.cons` objectDir)
|
||||||
-- Disable rename detection.
|
-- Disable rename detection.
|
||||||
, Param "--no-renames"
|
, Param "--no-renames"
|
||||||
-- Avoid other complications.
|
-- Avoid other complications.
|
||||||
|
|
|
@ -303,7 +303,7 @@ setupRepo gcryptid r
|
||||||
- which is needed for rsync of objects to it to work.
|
- which is needed for rsync of objects to it to work.
|
||||||
-}
|
-}
|
||||||
rsyncsetup = Remote.Rsync.withRsyncScratchDir $ \tmp -> do
|
rsyncsetup = Remote.Rsync.withRsyncScratchDir $ \tmp -> do
|
||||||
createAnnexDirectory (toRawFilePath (tmp </> objectDir))
|
createAnnexDirectory (toRawFilePath tmp P.</> objectDir)
|
||||||
dummycfg <- liftIO dummyRemoteGitConfig
|
dummycfg <- liftIO dummyRemoteGitConfig
|
||||||
let (rsynctransport, rsyncurl, _) = rsyncTransport r dummycfg
|
let (rsynctransport, rsyncurl, _) = rsyncTransport r dummycfg
|
||||||
let tmpconfig = tmp </> "config"
|
let tmpconfig = tmp </> "config"
|
||||||
|
@ -467,7 +467,7 @@ checkKey' repo r rsyncopts accessmethod k
|
||||||
{- Annexed objects are hashed using lower-case directories for max
|
{- Annexed objects are hashed using lower-case directories for max
|
||||||
- portability. -}
|
- portability. -}
|
||||||
gCryptLocation :: Git.Repo -> Key -> FilePath
|
gCryptLocation :: Git.Repo -> Key -> FilePath
|
||||||
gCryptLocation repo key = Git.repoLocation repo </> objectDir
|
gCryptLocation repo key = Git.repoLocation repo </> fromRawFilePath objectDir
|
||||||
</> fromRawFilePath (keyPath key (hashDirLower def))
|
</> fromRawFilePath (keyPath key (hashDirLower def))
|
||||||
|
|
||||||
data AccessMethod = AccessRsyncOverSsh | AccessGitAnnexShell
|
data AccessMethod = AccessRsyncOverSsh | AccessGitAnnexShell
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue