summaryrefslogtreecommitdiff
path: root/Git/Branch.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Git/Branch.hs')
-rw-r--r--Git/Branch.hs5
1 files changed, 1 insertions, 4 deletions
diff --git a/Git/Branch.hs b/Git/Branch.hs
index 1d5ffd39d..5c6135d57 100644
--- a/Git/Branch.hs
+++ b/Git/Branch.hs
@@ -44,10 +44,7 @@ currentUnsafe r = parse . firstLine
| otherwise = Just $ Git.Ref l
currentSha :: Repo -> IO (Maybe Git.Sha)
-currentSha r = go =<< current r
- where
- go Nothing = return Nothing
- go (Just ref) = Git.Ref.sha ref r
+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. -}