githash 0.1.3.1 → 0.1.3.2
raw patch · 5 files changed
+19/−11 lines, 5 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- ChangeLog.md +4/−0
- githash.cabal +3/−3
- test/GitHashSpec.hs +12/−6
- test/NormalRepoSpec.hs +0/−1
- test/RepoWithASubmoduleSpec.hs +0/−1
ChangeLog.md view
@@ -1,5 +1,9 @@ # ChangeLog for githash +## 0.1.3.2++* Test suite works outside of a Git repo [#12](https://github.com/snoyberg/githash/issues/12)+ ## 0.1.3.1 * Clean up some warnings (addresses [fpco/optparse-simple#11](https://github.com/fpco/optparse-simple/issues/11))
githash.cabal view
@@ -1,13 +1,13 @@ cabal-version: 1.12 --- This file has been generated from package.yaml by hpack version 0.31.1.+-- This file has been generated from package.yaml by hpack version 0.31.2. -- -- see: https://github.com/sol/hpack ----- hash: e259226f20bb47090315089e5ac66234ed83b30d011b5f6dc29b4f74f8134b58+-- hash: f6bf56388f86c4e1f54aad7088b785d703df1b2563a22a762004688b69a0048f name: githash-version: 0.1.3.1+version: 0.1.3.2 synopsis: Compile git revision info into Haskell projects description: Please see the README and documentation at <https://www.stackage.org/package/githash> category: Development
test/GitHashSpec.hs view
@@ -4,15 +4,21 @@ ) where import GitHash+import System.Directory (doesDirectoryExist) import Test.Hspec spec :: Spec spec = do describe "tGitInfoCwd" $ do it "makes vaguely sane git info for this repository" $ do- let gi = $$tGitInfoCwd- length (giHash gi)`shouldNotBe` 128- giBranch gi `shouldNotBe` []- seq (giDirty gi) () `shouldBe` ()- giCommitDate gi `shouldNotBe` []- giCommitCount gi `shouldSatisfy` (>= 1)+ let egi = $$tGitInfoCwdTry+ gitDirExists <- doesDirectoryExist ".git"+ case egi of+ Left _ -> gitDirExists `shouldBe` False+ Right gi -> do+ -- Doesn't work with cabal gitDirExists `shouldBe` True+ length (giHash gi)`shouldNotBe` 128+ giBranch gi `shouldNotBe` []+ seq (giDirty gi) () `shouldBe` ()+ giCommitDate gi `shouldNotBe` []+ giCommitCount gi `shouldSatisfy` (>= 1)
test/NormalRepoSpec.hs view
@@ -5,7 +5,6 @@ ( spec ) where -import Control.Exception import Control.Monad import qualified Data.ByteString as SB import GitHash
test/RepoWithASubmoduleSpec.hs view
@@ -5,7 +5,6 @@ ( spec ) where -import Control.Exception import Control.Monad import qualified Data.ByteString as SB import GitHash