aboutsummaryrefslogtreecommitdiff
path: root/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 /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 'Git.hs')
-rw-r--r--Git.hs6
1 files changed, 3 insertions, 3 deletions
diff --git a/Git.hs b/Git.hs
index 6e270815e..1bc789f85 100644
--- a/Git.hs
+++ b/Git.hs
@@ -60,7 +60,7 @@ repoLocation Repo { location = Url url } = show url
repoLocation Repo { location = Local { worktree = Just dir } } = dir
repoLocation Repo { location = Local { gitdir = dir } } = dir
repoLocation Repo { location = LocalUnknown dir } = dir
-repoLocation Repo { location = Unknown } = undefined
+repoLocation Repo { location = Unknown } = error "unknown repoLocation"
{- Path to a repository. For non-bare, this is the worktree, for bare,
- it's the gitdir, and for URL repositories, is the path on the remote
@@ -70,12 +70,12 @@ repoPath Repo { location = Url u } = unEscapeString $ uriPath u
repoPath Repo { location = Local { worktree = Just d } } = d
repoPath Repo { location = Local { gitdir = d } } = d
repoPath Repo { location = LocalUnknown dir } = dir
-repoPath Repo { location = Unknown } = undefined
+repoPath Repo { location = Unknown } = error "unknown repoPath"
{- Path to a local repository's .git directory. -}
localGitDir :: Repo -> FilePath
localGitDir Repo { location = Local { gitdir = d } } = d
-localGitDir _ = undefined
+localGitDir _ = error "unknown localGitDir"
{- Some code needs to vary between URL and normal repos,
- or bare and non-bare, these functions help with that. -}