summaryrefslogtreecommitdiff
path: root/Remote/Git.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-05-12 13:23:22 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-05-12 13:23:22 -0400
commit4d49342612dd441cdc503b5294035fc05a9a5a77 (patch)
tree435a82d44b5a6aa3df411b36fb9fad2553cc670a /Remote/Git.hs
parent44a48a19ffeb8085e7ae1f6bf58d5661adaf8a8d (diff)
parent5cd9e10cde3c06ecc6a97f5f60a9def22f959bd2 (diff)
Merge branch 'master' into concurrentprogress
Conflicts: Command/Fsck.hs Messages.hs Remote/Directory.hs Remote/Git.hs Remote/Helper/Special.hs Types/Remote.hs debian/changelog git-annex.cabal
Diffstat (limited to 'Remote/Git.hs')
-rw-r--r--Remote/Git.hs20
1 files changed, 14 insertions, 6 deletions
diff --git a/Remote/Git.hs b/Remote/Git.hs
index 2807c62fb..170c6fbf6 100644
--- a/Remote/Git.hs
+++ b/Remote/Git.hs
@@ -200,7 +200,7 @@ tryGitConfigRead :: Git.Repo -> Annex Git.Repo
tryGitConfigRead r
| haveconfig r = return r -- already read
| Git.repoIsSsh r = store $ do
- v <- Ssh.onRemote r (pipedconfig, return (Left undefined)) "configlist" [] []
+ v <- Ssh.onRemote r (pipedconfig, return (Left $ error "configlist failed")) "configlist" [] []
case v of
Right r'
| haveconfig r' -> return r'
@@ -229,9 +229,10 @@ tryGitConfigRead r
uo <- Url.getUrlOptions
v <- liftIO $ withTmpFile "git-annex.tmp" $ \tmpfile h -> do
hClose h
- ifM (Url.downloadQuiet (Git.repoLocation r ++ "/config") tmpfile uo)
+ let url = Git.repoLocation r ++ "/config"
+ ifM (Url.downloadQuiet url tmpfile uo)
( pipedconfig "git" [Param "config", Param "--null", Param "--list", Param "--file", File tmpfile]
- , return $ Left undefined
+ , return $ Left $ error $ "unable to load config from " ++ url
)
case v of
Left _ -> do
@@ -450,10 +451,17 @@ copyFromRemote' r key file dest meterupdate
copyFromRemoteCheap :: Remote -> Key -> AssociatedFile -> FilePath -> Annex Bool
#ifndef mingw32_HOST_OS
copyFromRemoteCheap r key af file
- | not $ Git.repoIsUrl (repo r) = guardUsable (repo r) (return False) $ do
- loc <- liftIO $ gitAnnexLocation key (repo r) $
+ | not $ Git.repoIsUrl (repo r) = guardUsable (repo r) (return False) $ liftIO $ do
+ loc <- gitAnnexLocation key (repo r) $
fromJust $ remoteGitConfig $ gitconfig r
- liftIO $ catchBoolIO $ createSymbolicLink loc file >> return True
+ ifM (doesFileExist loc)
+ ( do
+ absloc <- absPath loc
+ catchBoolIO $ do
+ createSymbolicLink absloc file
+ return True
+ , return False
+ )
| Git.repoIsSsh (repo r) =
ifM (Annex.Content.preseedTmp key file)
( parallelMetered Nothing key af $