@@ -32,15 +32,7 @@
3232-- > % cabal exec runhaskell Example.hs
3333-- > Example.hs: [panic master@2ae047ba5e4a6f0f3e705a43615363ac006099c1 (Mon Jan 11 11:50:59 2016 -0800) (14 commits in HEAD) (uncommitted files present)] oh no!
3434
35−module Development.GitRev
36− ( gitBranch
37− , gitCommitCount
38− , gitCommitDate
39− , gitDescribe
40− , gitDirty
41− , gitDirtyTracked
42− , gitHash
43− ) where
35+module Development.GitRev (gitHash, gitBranch, gitDirty, gitDirtyTracked, gitCommitCount, gitCommitDate) where
4436
4537import Control.Exception
4638import Control.Monad
@@ -66,7 +58,7 @@ runGit args def useIdx = do
6658 if gitFound
6759 then do
6860 -- a lot of bookkeeping to record the right dependencies
69− pwd <- runIO getDotGit
61+ pwd <- runIO getGitDirectory
7062 let hd = pwd </> ".git" </> "HEAD"
7163 index = pwd </> ".git" </> "index"
7264 packedRefs = pwd </> ".git" </> "packed-refs"
@@ -121,7 +113,7 @@ getDotGit = do
121113getGitRoot :: IO FilePath
122114getGitRoot = do
123115 pwd <- getCurrentDirectory
124− (code, out, _) <-
116+ (code, out, err) <-
125117 readProcessWithExitCode "git" ["rev-parse", "--show-toplevel"] ""
126118 case code of
127119 ExitSuccess -> return $ takeWhile (/= '\n') out
@@ -145,12 +137,6 @@ gitBranch :: ExpQ
145137gitBranch =
146138 stringE =<< runGit ["rev-parse", "--abbrev-ref", "HEAD"] "UNKNOWN" IdxNotUsed
147139
148−-- | Return the long git description for the current git commit, or
149−-- @UNKNOWN@ if not in a git repository.
150−gitDescribe :: ExpQ
151−gitDescribe =
152− stringE =<< runGit ["describe", "--long", "--always"] "UNKNOWN" IdxNotUsed
153−
154140-- | Return @True@ if there are non-committed files present in the
155141-- repository
156142gitDirty :: ExpQ