From 5d306fc27f2d049f87bb025326af1cc5ee162bb8 Mon Sep 17 00:00:00 2001 From: Jesse Kempf Date: Mon, 23 Sep 2019 16:04:47 -0700 Subject: [PATCH] Expose git tree too --- src/Development/GitRev.hs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Development/GitRev.hs b/src/Development/GitRev.hs index b664692..f09f5a5 100644 --- a/src/Development/GitRev.hs +++ b/src/Development/GitRev.hs @@ -40,6 +40,7 @@ module Development.GitRev , gitDirty , gitDirtyTracked , gitHash + , gitTree ) where import Control.Exception @@ -178,3 +179,8 @@ gitCommitCount = gitCommitDate :: ExpQ gitCommitDate = stringE =<< runGit ["log", "HEAD", "-1", "--format=%cd"] "UNKNOWN" IdxNotUsed + +-- | Return the hash of the current tree +gitTree :: ExpQ +gitTree = + stringE =<< runGit ["show", "HEAD", "--format=%T", "--no-patch"] "UNKNOWN" IdxNotUsed