summaryrefslogtreecommitdiff
path: root/Locations.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-03-04 16:00:24 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-03-04 19:12:58 -0400
commit52e88f3ebf974c3802e951e17593ce5768c04b92 (patch)
treeed87ada9f7e15dcb295ae0310fbf731175cf101b /Locations.hs
parentfba66c55ed3e060aae90fe90b5ea8e3ec4132bb7 (diff)
add remote start and stop hooks
Locking is used, so that, if there are multiple git-annex processes using a remote concurrently, the stop hook is only run by the last process that uses it.
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 244388e0e..18df06004 100644
--- a/Locations.hs
+++ b/Locations.hs
@@ -24,6 +24,7 @@ module Locations (
gitAnnexIndexLock,
gitAnnexIndexDirty,
gitAnnexSshDir,
+ gitAnnexRemotesDir,
isLinkToAnnex,
annexHashes,
hashDirMixed,
@@ -152,6 +153,10 @@ gitAnnexIndexDirty r = gitAnnexDir r </> "index.dirty"
gitAnnexSshDir :: Git.Repo -> FilePath
gitAnnexSshDir r = addTrailingPathSeparator $ gitAnnexDir r </> "ssh"
+{- .git/annex/remotes/ is used for remote-specific state. -}
+gitAnnexRemotesDir :: Git.Repo -> FilePath
+gitAnnexRemotesDir r = addTrailingPathSeparator $ gitAnnexDir r </> "remotes"
+
{- Checks a symlink target to see if it appears to point to annexed content. -}
isLinkToAnnex :: FilePath -> Bool
isLinkToAnnex s = ("/.git/" ++ objectDir) `isInfixOf` s