Skip to content

Commit

Permalink
Read git tags using the "git" command line tool
Browse files Browse the repository at this point in the history
to work around jwiegley/gitlib#49
  • Loading branch information
nomeata committed Jun 21, 2015
1 parent 33156f7 commit 2d53e4c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/Development/Shake/Gitlib.hs
Original file line number Diff line number Diff line change
Expand Up @@ -62,18 +62,20 @@ getGitContents repoPath = do

-- Will also look through annotated tags
getGitReference' :: RepoPath -> RefName -> IO T.Text
{- This fails (https://github.com/jwiegley/gitlib/issues/49), so use command
- line git instead.
getGitReference' repoPath refName = do
withRepository lgFactory repoPath $ do
Just ref <- resolveReference refName
{-
This fails (https://github.com/jwiegley/gitlib/issues/49)
o <- lookupObject ref
r <- case o of
TagObj t -> do
return $ renderObjOid $ tagCommit t
_ -> return $ renderOid ref
-}
return $ renderOid ref
-}
getGitReference' repoPath refName = do
T.pack . concat . lines . fromStdout <$> cmd ["git", "-C", repoPath, "rev-parse", T.unpack refName++"^{commit}"]

getGitFileRef' :: RepoPath -> T.Text -> FilePath -> IO (Maybe T.Text)
getGitFileRef' repoPath ref' fn = do
Expand Down

0 comments on commit 2d53e4c

Please sign in to comment.