aboutsummaryrefslogtreecommitdiffstats
path: root/app/Git.hs
diff options
context:
space:
mode:
authorLibravatar Alexander Foremny <aforemny@posteo.de>2023-10-23 10:08:49 +0200
committerLibravatar Alexander Foremny <aforemny@posteo.de>2023-11-07 09:50:52 +0100
commit2e032a5210d5166a42797ee8f296ec4228d6d838 (patch)
treebb71d1b466581114ffd7613d950533ffc1298834 /app/Git.hs
parent1127c71fa5f5c5a3d6bfde818cb00eb26e9d4cb3 (diff)
add `Git.getRootDir`
Diffstat (limited to 'app/Git.hs')
-rw-r--r--app/Git.hs4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/Git.hs b/app/Git.hs
index 7891288..c72edea 100644
--- a/app/Git.hs
+++ b/app/Git.hs
@@ -1,6 +1,7 @@
module Git
( withWorkingTree,
getCommitHashes,
+ getRootDir,
)
where
@@ -22,3 +23,6 @@ withWorkingTree path hash action = do
getCommitHashes :: IO [T.Text]
getCommitHashes = T.lines . T.decodeUtf8 . LB8.toStrict <$> sh "git log --format=%H"
+
+getRootDir :: IO FilePath
+getRootDir = T.unpack . T.decodeUtf8 . LB8.toStrict <$> sh (proc "git rev-parse --show-toplevel")