From 0ba4b1de18acf9e2318da6c8e7d80ce4bb216850 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 11 Dec 2011 14:14:28 -0400 Subject: [PATCH] move a file location to Locations.hs --- Annex/Branch.hs | 6 +----- Locations.hs | 5 +++++ 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Annex/Branch.hs b/Annex/Branch.hs index 37237ec667..44ee69e627 100644 --- a/Annex/Branch.hs +++ b/Annex/Branch.hs @@ -43,10 +43,6 @@ fullname = Git.Ref $ "refs/heads/" ++ show name originname :: Git.Ref originname = Git.Ref $ "origin/" ++ show name -{- A separate index file for the branch. -} -index :: Git.Repo -> FilePath -index g = gitAnnexDir g "index" - {- Populates the branch's index file with the current branch contents. - - Usually, this is only done when the index doesn't yet exist, and @@ -62,7 +58,7 @@ withIndex :: Annex a -> Annex a withIndex = withIndex' False withIndex' :: Bool -> Annex a -> Annex a withIndex' bootstrapping a = do - f <- fromRepo index + f <- fromRepo gitAnnexIndex bracketIO (Git.useIndex f) id $ do unlessM (liftIO $ doesFileExist f) $ do unless bootstrapping create diff --git a/Locations.hs b/Locations.hs index f7784a56d5..fdb8232844 100644 --- a/Locations.hs +++ b/Locations.hs @@ -20,6 +20,7 @@ module Locations ( gitAnnexUnusedLog, gitAnnexJournalDir, gitAnnexJournalLock, + gitAnnexIndex, isLinkToAnnex, annexHashes, hashDirMixed, @@ -131,6 +132,10 @@ gitAnnexJournalDir r = addTrailingPathSeparator $ gitAnnexDir r "journal" gitAnnexJournalLock :: Git.Repo -> FilePath gitAnnexJournalLock r = gitAnnexDir r "journal.lck" +{- .git/annex/index is used to stage changes to the git-annex branch -} +gitAnnexIndex :: Git.Repo -> FilePath +gitAnnexIndex r = gitAnnexDir r "index" + {- Checks a symlink target to see if it appears to point to annexed content. -} isLinkToAnnex :: FilePath -> Bool isLinkToAnnex s = ("/.git/" ++ objectDir) `isInfixOf` s