summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Command/Sync.hs15
-rw-r--r--debian/changelog2
2 files changed, 11 insertions, 6 deletions
diff --git a/Command/Sync.hs b/Command/Sync.hs
index 28d7c69c5..2299306ed 100644
--- a/Command/Sync.hs
+++ b/Command/Sync.hs
@@ -227,12 +227,15 @@ pullRemote remote branch = do
- while the synced/master may have changes that some
- other remote synced to this remote. So, merge them both. -}
mergeRemote :: Remote -> Maybe Git.Ref -> CommandCleanup
-mergeRemote remote b = case b of
- Nothing -> do
- branch <- inRepo Git.Branch.currentUnsafe
- and <$> mapM (merge Nothing) (branchlist branch)
- Just thisbranch ->
- and <$> (mapM (merge (Just thisbranch)) =<< tomerge (branchlist b))
+mergeRemote remote b = ifM isBareRepo
+ ( return True
+ , case b of
+ Nothing -> do
+ branch <- inRepo Git.Branch.currentUnsafe
+ and <$> mapM (merge Nothing) (branchlist branch)
+ Just thisbranch ->
+ and <$> (mapM (merge (Just thisbranch)) =<< tomerge (branchlist b))
+ )
where
merge thisbranch br = autoMergeFrom (remoteBranch remote br) thisbranch Git.Branch.ManualCommit
tomerge = filterM (changed remote)
diff --git a/debian/changelog b/debian/changelog
index 8fc917235..1efbdd9da 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -7,6 +7,8 @@ git-annex (5.20141232) UNRELEASED; urgency=medium
Closes: #774494
* Fix build with process 1.2.1.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