refactor and check for a detached HEAD
This commit is contained in:
parent
8a33573caf
commit
a2ec2d3760
2 changed files with 11 additions and 6 deletions
|
@ -14,6 +14,14 @@ import Git
|
|||
import Git.Sha
|
||||
import Git.Command
|
||||
|
||||
{- The currently checked out branch. -}
|
||||
current :: Repo -> IO (Maybe Git.Ref)
|
||||
current r = parse <$> pipeRead [Param "symbolic-ref", Param "HEAD"] r
|
||||
where
|
||||
parse v
|
||||
| L.null v = Nothing
|
||||
| otherwise = Just $ Git.Ref $ firstLine $ L.unpack v
|
||||
|
||||
{- Checks if the second branch has any commits not present on the first
|
||||
- branch. -}
|
||||
changed :: Branch -> Branch -> Repo -> IO Bool
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue