From e4569bfba863487440345937533e0af6cd427b37 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 17 Aug 2013 21:29:44 +0200 Subject: sync, merge: Bug fix: Don't try to merge into master when in a bare repo. --- Command/Sync.hs | 11 +++++++---- debian/changelog | 1 + 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Command/Sync.hs b/Command/Sync.hs index a6ae610f8..551c2fa69 100644 --- a/Command/Sync.hs +++ b/Command/Sync.hs @@ -101,10 +101,13 @@ mergeLocal :: Git.Ref -> CommandStart mergeLocal branch = go =<< needmerge where syncbranch = syncBranch branch - needmerge = do - unlessM (inRepo $ Git.Ref.exists syncbranch) $ - inRepo $ updateBranch syncbranch - inRepo $ Git.Branch.changed branch syncbranch + needmerge = ifM isBareRepo + ( return False + , do + unlessM (inRepo $ Git.Ref.exists syncbranch) $ + inRepo $ updateBranch syncbranch + inRepo $ Git.Branch.changed branch syncbranch + ) go False = stop go True = do showStart "merge" $ Git.Ref.describe syncbranch diff --git a/debian/changelog b/debian/changelog index a4d6599ba..150307c22 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,6 +3,7 @@ git-annex (4.20130816) UNRELEASED; urgency=low * Debian: Run the builtin test suite as an autopkgtest. * Debian: Recommend ssh-askpass, which ssh will use when the assistant is run w/o a tty. Closes: #719832 + * sync, merge: Bug fix: Don't try to merge into master when in a bare repo. -- Joey Hess Thu, 15 Aug 2013 15:47:52 +0200 -- cgit v1.2.3