diff options
author | Joey Hess <joeyh@joeyh.name> | 2017-02-15 13:55:06 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2017-02-15 13:55:06 -0400 |
commit | 1d9c111ba75d3c8ab7dc4b148805582a722efc6d (patch) | |
tree | 92b85f549a52a235610e4923045d3c66790a99e8 /Command | |
parent | f5d8a3b7cc7910971ecd7d388111ef4cfc7da778 (diff) |
forgot to compile last commit; fix mistakes
Diffstat (limited to 'Command')
-rw-r--r-- | Command/Sync.hs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/Command/Sync.hs b/Command/Sync.hs index e885990a4..d095ae20a 100644 --- a/Command/Sync.hs +++ b/Command/Sync.hs @@ -272,17 +272,16 @@ commitStaged commitmode commitmessage = do return True mergeLocal :: [Git.Merge.MergeConfig] -> CurrBranch -> CommandStart -mergeLocal mergeconfig currbranch@(Just branch, madj) = +mergeLocal mergeconfig currbranch@(Just _, _) = go =<< needMerge currbranch where go Nothing = stop go (Just syncbranch) = do showStart "merge" $ Git.Ref.describe syncbranch next $ next $ merge currbranch mergeconfig Git.Branch.ManualCommit syncbranch - syncbranch = syncBranch branch mergeLocal _ (Nothing, madj) = do b <- inRepo Git.Branch.currentUnsafe - ifM (needMerge (b, madj)) + ifM (isJust <$> needMerge (b, madj)) ( do warning $ "There are no commits yet in the currently checked out branch, so cannot merge any remote changes into it." next $ next $ return False @@ -292,7 +291,7 @@ mergeLocal _ (Nothing, madj) = do -- Returns the branch that should be merged, if any. needMerge :: CurrBranch -> Annex (Maybe Git.Branch) needMerge (Nothing, _) = return Nothing -needMerge (Just branch, madj) = ifM (allM checks) +needMerge (Just branch, madj) = ifM (allM id checks) ( return (Just syncbranch) , return Nothing ) |