diff options
author | Joey Hess <joey@kitenet.net> | 2013-09-24 17:51:12 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2013-09-24 17:51:12 -0400 |
commit | 2270913743982ab33c68d17c8ed68326e1711f95 (patch) | |
tree | dbc8b7ad18e705345cb27daf051e8ff131a5031e /Remote/Git.hs | |
parent | e079835fdd71231f680b86fac4f283d8d1afa2e0 (diff) |
add back lost check that git-annex-shell supports gcrypt
Diffstat (limited to 'Remote/Git.hs')
-rw-r--r-- | Remote/Git.hs | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/Remote/Git.hs b/Remote/Git.hs index 2761995b2..6876ec4b4 100644 --- a/Remote/Git.hs +++ b/Remote/Git.hs @@ -165,18 +165,16 @@ tryGitConfigRead r safely a = either (const $ return r) return =<< liftIO (try a :: IO (Either SomeException Git.Repo)) - pipedconfig cmd params = try run :: IO (Either SomeException Git.Repo) - where - run = withHandle StdoutHandle createProcessSuccess p $ \h -> do - fileEncoding h - val <- hGetContentsStrict h - r' <- Git.Config.store val r - when (getUncachedUUID r' == NoUUID && not (null val)) $ do - warningIO $ "Failed to get annex.uuid configuration of repository " ++ Git.repoDescribe r - warningIO $ "Instead, got: " ++ show val - warningIO $ "This is unexpected; please check the network transport!" - return r' - p = proc cmd $ toCommand params + pipedconfig cmd params = do + v <- Git.Config.fromPipe r cmd params + case v of + Right (r', val) -> do + when (getUncachedUUID r' == NoUUID && not (null val)) $ do + warningIO $ "Failed to get annex.uuid configuration of repository " ++ Git.repoDescribe r + warningIO $ "Instead, got: " ++ show val + warningIO $ "This is unexpected; please check the network transport!" + return $ Right r' + Left l -> return $ Left l geturlconfig headers = do v <- liftIO $ withTmpFile "git-annex.tmp" $ \tmpfile h -> do |