summaryrefslogtreecommitdiff
path: root/Git/Branch.hs
diff options
context:
space:
mode:
authorJoey Hess <joeyh@joeyh.name>2015-01-06 19:02:48 -0400
committerJoey Hess <joeyh@joeyh.name>2015-01-06 19:02:48 -0400
commit9af9872f0f54d5d4af2aed3d08eef9ab67012261 (patch)
tree4849db9d9bfa08603a4d0913bb1fbbf14213b4a4 /Git/Branch.hs
parent46b630831bda126b6f4ab723229e32c1677ae6d0 (diff)
downloadgit-repair-9af9872f0f54d5d4af2aed3d08eef9ab67012261.tar.gz
Merge from git-annex.
Diffstat (limited to 'Git/Branch.hs')
-rw-r--r--Git/Branch.hs3
1 files changed, 3 insertions, 0 deletions
diff --git a/Git/Branch.hs b/Git/Branch.hs
index 0b7d888..5c6135d 100644
--- a/Git/Branch.hs
+++ b/Git/Branch.hs
@@ -43,6 +43,9 @@ currentUnsafe r = parse . firstLine
| null l = Nothing
| otherwise = Just $ Git.Ref l
+currentSha :: Repo -> IO (Maybe Git.Sha)
+currentSha r = maybe (pure Nothing) (`Git.Ref.sha` r) =<< current r
+
{- Checks if the second branch has any commits not present on the first
- branch. -}
changed :: Branch -> Branch -> Repo -> IO Bool