From 8b8506748c362241d39cbf4cf04714f8462489da Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 17 Oct 2013 14:51:19 -0400 Subject: use TopFilePath for DiffTree and LsTree --- Git/FilePath.hs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'Git/FilePath.hs') diff --git a/Git/FilePath.hs b/Git/FilePath.hs index 891f9991d..37d740f25 100644 --- a/Git/FilePath.hs +++ b/Git/FilePath.hs @@ -14,6 +14,7 @@ module Git.FilePath ( TopFilePath, + fromTopFilePath, getTopFilePath, toTopFilePath, asTopFilePath, @@ -27,6 +28,11 @@ import Git {- A FilePath, relative to the top of the git repository. -} newtype TopFilePath = TopFilePath { getTopFilePath :: FilePath } + deriving (Show) + +{- Returns an absolute FilePath. -} +fromTopFilePath :: TopFilePath -> Git.Repo -> FilePath +fromTopFilePath p repo = absPathFrom (repoPath repo) (getTopFilePath p) {- The input FilePath can be absolute, or relative to the CWD. -} toTopFilePath :: FilePath -> Git.Repo -> IO TopFilePath -- cgit v1.2.3