summaryrefslogtreecommitdiff
path: root/Core.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2010-10-31 23:21:16 -0400
committerGravatar Joey Hess <joey@kitenet.net>2010-10-31 23:21:16 -0400
commitf3e4633e359d0a4afc7a0f90a89e4d276b597d84 (patch)
tree4c90c61c6ce6f09f546a5e412d8c23f82de67013 /Core.hs
parent0194394be61dba0324a5a99f462aa2206066771c (diff)
refactor inAnnex remote checking to Remotes
Diffstat (limited to 'Core.hs')
-rw-r--r--Core.hs13
1 files changed, 3 insertions, 10 deletions
diff --git a/Core.hs b/Core.hs
index e2e6eaa0c..ab7291aff 100644
--- a/Core.hs
+++ b/Core.hs
@@ -86,19 +86,12 @@ gitPreCommitHook repo = do
p <- getPermissions hook
setPermissions hook $ p {executable = True}
-{- Checks if a given key is currently present in the annexLocation.
- -
- - This can be run against a remote repository to check the key there. -}
+{- Checks if a given key is currently present in the annexLocation. -}
inAnnex :: Key -> Annex Bool
inAnnex key = do
g <- Annex.gitRepo
- if (not $ Git.repoIsUrl g)
- then liftIO $ doesFileExist $ annexLocation g key
- else do
- showNote ("checking " ++ Git.repoDescribe g ++ "...")
- liftIO $ boolSystem "ssh" [Git.urlHost g,
- "test -e " ++
- (shellEscape $ annexLocation g key)]
+ when (Git.repoIsUrl g) $ error "inAnnex cannot check remote repo"
+ liftIO $ doesFileExist $ annexLocation g key
{- Calculates the relative path to use to link a file to a key. -}
calcGitLink :: FilePath -> Key -> Annex FilePath