diff options
author | Joey Hess <joey@kitenet.net> | 2013-08-17 21:29:44 +0200 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2013-08-17 21:29:44 +0200 |
commit | e4569bfba863487440345937533e0af6cd427b37 (patch) | |
tree | f32ecf49084c2e03b3ba394d224097de7a129065 /Command/Sync.hs | |
parent | 76752c35770417fd29fafd68a7c4698091880153 (diff) |
sync, merge: Bug fix: Don't try to merge into master when in a bare repo.
Diffstat (limited to 'Command/Sync.hs')
-rw-r--r-- | Command/Sync.hs | 11 |
1 files changed, 7 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 |