From ce7e52101cda2715bc4ca0a758884d67fb40669e Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 3 Mar 2016 16:19:09 -0400 Subject: working toward adjusted commit propigation --- Command/Sync.hs | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'Command/Sync.hs') diff --git a/Command/Sync.hs b/Command/Sync.hs index 355f71d1d..e6a8373ce 100644 --- a/Command/Sync.hs +++ b/Command/Sync.hs @@ -267,21 +267,20 @@ pushLocal b = do updateSyncBranch :: CurrBranch -> Annex () updateSyncBranch (Nothing, _) = noop -updateSyncBranch (Just branch, _) = do +updateSyncBranch (Just branch, madj) = do -- When in an adjusted branch, propigate any changes to it back to -- the original branch. - branch' <- case adjustedToOriginal branch of - Just (adj, origbranch) -> do - propigateAdjustedCommits origbranch adj - return origbranch - Nothing -> return branch + case madj of + Just adj -> propigateAdjustedCommits branch + (adj, originalToAdjusted branch adj) + Nothing -> return () -- Update the sync branch to match the new state of the branch - inRepo $ updateBranch (syncBranch branch') branch' + inRepo $ updateBranch (syncBranch branch) branch -- In direct mode, we're operating on some special direct mode -- branch, rather than the intended branch, so update the intended -- branch. whenM isDirect $ - inRepo $ updateBranch (fromDirectBranch branch') branch' + inRepo $ updateBranch (fromDirectBranch branch) branch updateBranch :: Git.Branch -> Git.Branch -> Git.Repo -> IO () updateBranch syncbranch updateto g = -- cgit v1.2.3