sync: Fix an edge case where syncing in a bare repository would try to merge and so fail.
In the case where a remote of the bare repo has a fetch = configuration, refs/remotes/origin/master will exist, and so the merge code path tried to run in the bare repo.
This commit is contained in:
parent
18f74b52bd
commit
584eac78e6
2 changed files with 11 additions and 6 deletions
|
@ -227,12 +227,15 @@ pullRemote remote branch = do
|
||||||
- while the synced/master may have changes that some
|
- while the synced/master may have changes that some
|
||||||
- other remote synced to this remote. So, merge them both. -}
|
- other remote synced to this remote. So, merge them both. -}
|
||||||
mergeRemote :: Remote -> Maybe Git.Ref -> CommandCleanup
|
mergeRemote :: Remote -> Maybe Git.Ref -> CommandCleanup
|
||||||
mergeRemote remote b = case b of
|
mergeRemote remote b = ifM isBareRepo
|
||||||
Nothing -> do
|
( return True
|
||||||
branch <- inRepo Git.Branch.currentUnsafe
|
, case b of
|
||||||
and <$> mapM (merge Nothing) (branchlist branch)
|
Nothing -> do
|
||||||
Just thisbranch ->
|
branch <- inRepo Git.Branch.currentUnsafe
|
||||||
and <$> (mapM (merge (Just thisbranch)) =<< tomerge (branchlist b))
|
and <$> mapM (merge Nothing) (branchlist branch)
|
||||||
|
Just thisbranch ->
|
||||||
|
and <$> (mapM (merge (Just thisbranch)) =<< tomerge (branchlist b))
|
||||||
|
)
|
||||||
where
|
where
|
||||||
merge thisbranch br = autoMergeFrom (remoteBranch remote br) thisbranch Git.Branch.ManualCommit
|
merge thisbranch br = autoMergeFrom (remoteBranch remote br) thisbranch Git.Branch.ManualCommit
|
||||||
tomerge = filterM (changed remote)
|
tomerge = filterM (changed remote)
|
||||||
|
|
2
debian/changelog
vendored
2
debian/changelog
vendored
|
@ -7,6 +7,8 @@ git-annex (5.20141232) UNRELEASED; urgency=medium
|
||||||
Closes: #774494
|
Closes: #774494
|
||||||
* Fix build with process 1.2.1.0.
|
* Fix build with process 1.2.1.0.
|
||||||
* Android: Provide a version built with -fPIE -pie to support Android 5.0.
|
* Android: Provide a version built with -fPIE -pie to support Android 5.0.
|
||||||
|
* sync: Fix an edge case where syncing in a bare repository would try to
|
||||||
|
merge and so fail.
|
||||||
|
|
||||||
-- Joey Hess <id@joeyh.name> Fri, 02 Jan 2015 13:35:13 -0400
|
-- Joey Hess <id@joeyh.name> Fri, 02 Jan 2015 13:35:13 -0400
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue