summaryrefslogtreecommitdiff
path: root/Locations.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-12-11 16:11:13 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-12-11 16:14:59 -0400
commitcfbbda99f4dd3e510e52dbb499d132300ad203e4 (patch)
tree0d3a392a631e982b1ccba1c3bc390ece9f39e98a /Locations.hs
parent8680c415dedcc1fdbbcc0b9cdd7e37e860b22130 (diff)
optimize index updating
The last branch ref that the index was updated to is stored in .git/annex/index.lck, and the index only updated when the current branch ref differs. (The .lck file should later be used for locking too.) Some more optimization is still needed, since there is some redundancy in calls to git show-ref.
Diffstat (limited to 'Locations.hs')
-rw-r--r--Locations.hs5
1 files changed, 5 insertions, 0 deletions
diff --git a/Locations.hs b/Locations.hs
index fdb823284..85fcb9888 100644
--- a/Locations.hs
+++ b/Locations.hs
@@ -21,6 +21,7 @@ module Locations (
gitAnnexJournalDir,
gitAnnexJournalLock,
gitAnnexIndex,
+ gitAnnexIndexLock,
isLinkToAnnex,
annexHashes,
hashDirMixed,
@@ -136,6 +137,10 @@ gitAnnexJournalLock r = gitAnnexDir r </> "journal.lck"
gitAnnexIndex :: Git.Repo -> FilePath
gitAnnexIndex r = gitAnnexDir r </> "index"
+{- Lock file for .git/annex/index. -}
+gitAnnexIndexLock :: Git.Repo -> FilePath
+gitAnnexIndexLock r = gitAnnexDir r </> "index.lck"
+
{- Checks a symlink target to see if it appears to point to annexed content. -}
isLinkToAnnex :: FilePath -> Bool
isLinkToAnnex s = ("/.git/" ++ objectDir) `isInfixOf` s