diff options
author | Joey Hess <joey@kitenet.net> | 2014-07-05 17:12:05 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2014-07-05 17:12:05 -0400 |
commit | 5edba1bfe62ac4e77906b5b0057280d2d616c61e (patch) | |
tree | 9fa17a7e67fa3d3159318a4a318c55938327020f | |
parent | dc7c9a5db72ff05d5eb835f2406f2626a33553df (diff) |
assistant: Fix bug, introduced in last release, that caused the assistant to make many unncessary empty merge commits.
-rw-r--r-- | Annex/AutoMerge.hs | 6 | ||||
-rw-r--r-- | Assistant/Threads/Merger.hs | 12 | ||||
-rw-r--r-- | debian/changelog | 2 | ||||
-rw-r--r-- | doc/bugs/Assistant_merge_loop.mdwn | 2 |
4 files changed, 16 insertions, 6 deletions
diff --git a/Annex/AutoMerge.hs b/Annex/AutoMerge.hs index cc27f6b28..b5c4b911d 100644 --- a/Annex/AutoMerge.hs +++ b/Annex/AutoMerge.hs @@ -28,7 +28,11 @@ import qualified Data.Set as S {- Merges from a branch into the current branch - (which may not exist yet), - - with automatic merge conflict resolution. -} + - with automatic merge conflict resolution. + - + - Callers should use Git.Branch.changed first, to make sure that + - there are changed from the current branch to the branch being merged in. + -} autoMergeFrom :: Git.Ref -> (Maybe Git.Ref) -> Git.Branch.CommitMode -> Annex Bool autoMergeFrom branch currbranch commitmode = do showOutput diff --git a/Assistant/Threads/Merger.hs b/Assistant/Threads/Merger.hs index 8d660da06..63c9968a7 100644 --- a/Assistant/Threads/Merger.hs +++ b/Assistant/Threads/Merger.hs @@ -79,11 +79,13 @@ onChange file mergecurrent (Just current) | equivBranches changedbranch current = do - debug - [ "merging", Git.fromRef changedbranch - , "into", Git.fromRef current - ] - void $ liftAnnex $ autoMergeFrom changedbranch (Just current) Git.Branch.AutomaticCommit + void $ liftAnnex $ autoMergeFrom changedbranch (Just current) Git.Branch.AutomaticCommit + whenM (liftAnnex $ inRepo $ Git.Branch.changed current changedbranch) $ do + debug + [ "merging", Git.fromRef changedbranch + , "into", Git.fromRef current + ] + void $ liftAnnex $ autoMergeFrom changedbranch (Just current) Git.Branch.AutomaticCommit mergecurrent _ = noop handleDesynced = case fromTaggedBranch changedbranch of diff --git a/debian/changelog b/debian/changelog index 6ddb7b401..701f07e53 100644 --- a/debian/changelog +++ b/debian/changelog @@ -18,6 +18,8 @@ git-annex (5.20140614) UNRELEASED; urgency=medium for git-annex branch commits and commits made by the assistant. * Fix memory leak when committing millions of changes to the git-annex branch, eg after git-annex add has run on 2 million files in one go. + * assistant: Fix bug, introduced in last release, that caused the assistant + to make many unncessary empty merge commits. -- Joey Hess <joeyh@debian.org> Mon, 16 Jun 2014 11:28:42 -0400 diff --git a/doc/bugs/Assistant_merge_loop.mdwn b/doc/bugs/Assistant_merge_loop.mdwn index d0d710866..de5b3a996 100644 --- a/doc/bugs/Assistant_merge_loop.mdwn +++ b/doc/bugs/Assistant_merge_loop.mdwn @@ -14,3 +14,5 @@ Using the standalone build, 64bit, on ArchLinux, Fedora 20 and Ubuntu 14.04. local repository version: 5 supported repository version: 5 upgrade supported from repository versions: 0 1 2 4 + +> [[fixed|done]] --[[Joey]] |