print a warning message when garbage is received from configlist

This commit is contained in:
Joey Hess 2013-03-04 23:27:18 -04:00
parent 9769235d6b
commit ff6ce2bc15
2 changed files with 16 additions and 2 deletions

View file

@ -161,8 +161,15 @@ tryGitConfigRead r
=<< liftIO (try a :: IO (Either SomeException Git.Repo))
pipedconfig cmd params =
withHandle StdoutHandle createProcessSuccess p $
Git.Config.hRead r
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'
where
p = proc cmd $ toCommand params