update sync branch to the orig branch when in adjusted branch
This commit is contained in:
parent
048d513233
commit
9731514c75
2 changed files with 8 additions and 7 deletions
|
@ -299,7 +299,7 @@ runPush checkcloudrepos (Pushing cid (PushRequest theiruuid)) =
|
||||||
(g, u) <- liftAnnex $ (,)
|
(g, u) <- liftAnnex $ (,)
|
||||||
<$> gitRepo
|
<$> gitRepo
|
||||||
<*> getUUID
|
<*> getUUID
|
||||||
liftIO $ Command.Sync.updateBranch (Command.Sync.syncBranch branch) g
|
liftIO $ Command.Sync.updateBranch (Command.Sync.syncBranch branch) branch g
|
||||||
selfjid <- ((T.unpack <$>) . xmppClientID) <$> getDaemonStatus
|
selfjid <- ((T.unpack <$>) . xmppClientID) <$> getDaemonStatus
|
||||||
if null rs
|
if null rs
|
||||||
then return Nothing
|
then return Nothing
|
||||||
|
|
|
@ -269,21 +269,22 @@ updateSyncBranch :: CurrBranch -> Annex ()
|
||||||
updateSyncBranch (Nothing, _) = noop
|
updateSyncBranch (Nothing, _) = noop
|
||||||
updateSyncBranch (Just branch, _) = do
|
updateSyncBranch (Just branch, _) = do
|
||||||
-- Update the sync branch to match the new state of the branch
|
-- Update the sync branch to match the new state of the branch
|
||||||
inRepo $ updateBranch $ syncBranch branch
|
inRepo $ updateBranch (syncBranch branch) branch
|
||||||
-- In direct mode, we're operating on some special direct mode
|
-- In direct mode, we're operating on some special direct mode
|
||||||
-- branch, rather than the intended branch, so update the indended
|
-- branch, rather than the intended branch, so update the intended
|
||||||
-- branch.
|
-- branch.
|
||||||
whenM isDirect $
|
whenM isDirect $
|
||||||
inRepo $ updateBranch $ fromDirectBranch branch
|
inRepo $ updateBranch (fromDirectBranch branch) branch
|
||||||
|
|
||||||
updateBranch :: Git.Branch -> Git.Repo -> IO ()
|
updateBranch :: Git.Branch -> Git.Branch -> Git.Repo -> IO ()
|
||||||
updateBranch syncbranch g =
|
updateBranch syncbranch updateto g =
|
||||||
unlessM go $ error $ "failed to update " ++ Git.fromRef syncbranch
|
unlessM go $ error $ "failed to update " ++ Git.fromRef syncbranch
|
||||||
where
|
where
|
||||||
go = Git.Command.runBool
|
go = Git.Command.runBool
|
||||||
[ Param "branch"
|
[ Param "branch"
|
||||||
, Param "-f"
|
, Param "-f"
|
||||||
, Param $ Git.fromRef $ Git.Ref.base syncbranch
|
, Param $ Git.fromRef $ Git.Ref.base syncbranch
|
||||||
|
, Param $ Git.fromRef $ updateto
|
||||||
] g
|
] g
|
||||||
|
|
||||||
pullRemote :: SyncOptions -> Remote -> CurrBranch -> CommandStart
|
pullRemote :: SyncOptions -> Remote -> CurrBranch -> CommandStart
|
||||||
|
@ -311,7 +312,7 @@ mergeRemote remote currbranch = ifM isBareRepo
|
||||||
branch <- inRepo Git.Branch.currentUnsafe
|
branch <- inRepo Git.Branch.currentUnsafe
|
||||||
mergelisted (pure (branchlist branch))
|
mergelisted (pure (branchlist branch))
|
||||||
(Just branch, _) -> do
|
(Just branch, _) -> do
|
||||||
inRepo $ updateBranch $ syncBranch branch
|
inRepo $ updateBranch (syncBranch branch) branch
|
||||||
mergelisted (tomerge (branchlist (Just branch)))
|
mergelisted (tomerge (branchlist (Just branch)))
|
||||||
)
|
)
|
||||||
where
|
where
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue