summaryrefslogtreecommitdiff
path: root/Remote/Git.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-04-19 00:38:29 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-04-19 00:38:29 -0400
commitc5910fd179d374f644ab3c843b243a51a7df9b24 (patch)
tree9623da2ab0411f3862d415a17be7be567688b714 /Remote/Git.hs
parentbf1bf600fc94f6b95d5723473b148b35ab32073d (diff)
removed all uses of undefined from code base
It's a code smell, can lead to hard to diagnose error messages.
Diffstat (limited to 'Remote/Git.hs')
-rw-r--r--Remote/Git.hs7
1 files changed, 4 insertions, 3 deletions
diff --git a/Remote/Git.hs b/Remote/Git.hs
index fdd0049ca..4804cb10e 100644
--- a/Remote/Git.hs
+++ b/Remote/Git.hs
@@ -199,7 +199,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'
@@ -228,9 +228,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