diff options
author | 2014-02-25 12:38:25 +0100 | |
---|---|---|
committer | 2014-02-25 12:38:25 +0100 | |
commit | d1147087b30b67a139e51235e977be27dc69765d (patch) | |
tree | 81898d4b8fd8ec569ddcc6150406866682fdb1ff /Remote/Git.hs | |
parent | 5fea20f32fbeba57b3be8f57b2a6f11da05641db (diff) | |
parent | 6cc6cf01d1644df543d3e264d3f9ddb44e64424b (diff) |
Merge branch 'master' of git://git-annex.branchable.com
Diffstat (limited to 'Remote/Git.hs')
-rw-r--r-- | Remote/Git.hs | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/Remote/Git.hs b/Remote/Git.hs index d714cfec5..d7385ef31 100644 --- a/Remote/Git.hs +++ b/Remote/Git.hs @@ -158,9 +158,7 @@ tryGitConfigRead r | haveconfig r' -> return r' | otherwise -> configlist_failed Left _ -> configlist_failed - | Git.repoIsHttp r = do - headers <- getHttpHeaders - store $ geturlconfig headers + | Git.repoIsHttp r = store geturlconfig | Git.GCrypt.isEncrypted r = handlegcrypt =<< getConfigMaybe (remoteConfig r "uuid") | Git.repoIsUrl r = return r | otherwise = store $ safely $ onLocal r $ do @@ -185,11 +183,11 @@ tryGitConfigRead r return $ Right r' Left l -> return $ Left l - geturlconfig headers = do - ua <- Url.getUserAgent + geturlconfig = do + uo <- Url.getUrlOptions v <- liftIO $ withTmpFile "git-annex.tmp" $ \tmpfile h -> do hClose h - ifM (Url.downloadQuiet (Git.repoLocation r ++ "/config") headers [] tmpfile ua) + ifM (Url.downloadQuiet (Git.repoLocation r ++ "/config") tmpfile uo) ( pipedconfig "git" [Param "config", Param "--null", Param "--list", Param "--file", File tmpfile] , return $ Left undefined ) @@ -255,14 +253,14 @@ tryGitConfigRead r -} inAnnex :: Remote -> Key -> Annex (Either String Bool) inAnnex rmt key - | Git.repoIsHttp r = checkhttp =<< getHttpHeaders + | Git.repoIsHttp r = checkhttp | Git.repoIsUrl r = checkremote | otherwise = checklocal where r = repo rmt - checkhttp headers = do + checkhttp = do showChecking r - ifM (anyM (\u -> Url.withUserAgent $ Url.checkBoth u headers (keySize key)) (keyUrls rmt key)) + ifM (Url.withUrlOptions $ \uo -> anyM (\u -> Url.checkBoth u (keySize key) uo) (keyUrls rmt key)) ( return $ Right True , return $ Left "not found" ) |