Deal with change in git 2.0 that made indirect mode merge conflict resolution leave behind old files.
I think this is a git behavior change, but have not checked to be sure. Conflict cruft used to look like $foo~HEAD, but now just $foo is left behind as conflict cruft. With test case.
This commit is contained in:
parent
cb66ca3a76
commit
61a35de433
3 changed files with 5 additions and 2 deletions
|
@ -177,7 +177,7 @@ resolveMerge' (Just us) them u = do
|
||||||
return (Just file)
|
return (Just file)
|
||||||
|
|
||||||
{- git-merge moves conflicting files away to files
|
{- git-merge moves conflicting files away to files
|
||||||
- named something like f~HEAD or f~branch, but the
|
- named something like f~HEAD or f~branch or just f, but the
|
||||||
- exact name chosen can vary. Once the conflict is resolved,
|
- exact name chosen can vary. Once the conflict is resolved,
|
||||||
- this cruft can be deleted. To avoid deleting legitimate
|
- this cruft can be deleted. To avoid deleting legitimate
|
||||||
- files that look like this, only delete files that are
|
- files that look like this, only delete files that are
|
||||||
|
@ -194,7 +194,7 @@ cleanConflictCruft resolvedfs top = do
|
||||||
liftIO $ nukeFile f
|
liftIO $ nukeFile f
|
||||||
| otherwise = noop
|
| otherwise = noop
|
||||||
s = S.fromList resolvedfs
|
s = S.fromList resolvedfs
|
||||||
matchesresolved f = S.member (base f) s
|
matchesresolved f = S.member f s || S.member (base f) s
|
||||||
base f = reverse $ drop 1 $ dropWhile (/= '~') $ reverse f
|
base f = reverse $ drop 1 $ dropWhile (/= '~') $ reverse f
|
||||||
|
|
||||||
commitResolvedMerge :: Git.Branch.CommitMode -> Annex Bool
|
commitResolvedMerge :: Git.Branch.CommitMode -> Annex Bool
|
||||||
|
|
1
Test.hs
1
Test.hs
|
@ -857,6 +857,7 @@ test_conflict_resolution testenv =
|
||||||
let v = filter (variantprefix `isPrefixOf`) l
|
let v = filter (variantprefix `isPrefixOf`) l
|
||||||
length v == 2
|
length v == 2
|
||||||
@? (what ++ " not exactly 2 variant files in: " ++ show l)
|
@? (what ++ " not exactly 2 variant files in: " ++ show l)
|
||||||
|
conflictor `notElem` l @? ("conflictor still present after conflict resolution")
|
||||||
indir testenv d $ do
|
indir testenv d $ do
|
||||||
git_annex testenv "get" v @? "get failed"
|
git_annex testenv "get" v @? "get failed"
|
||||||
git_annex_expectoutput testenv "find" v v
|
git_annex_expectoutput testenv "find" v v
|
||||||
|
|
2
debian/changelog
vendored
2
debian/changelog
vendored
|
@ -11,6 +11,8 @@ git-annex (5.20140710) UNRELEASED; urgency=medium
|
||||||
it.
|
it.
|
||||||
* resolvemerge: New plumbing command that runs the automatic merge conflict
|
* resolvemerge: New plumbing command that runs the automatic merge conflict
|
||||||
resolver.
|
resolver.
|
||||||
|
* Deal with change in git 2.0 that made indirect mode merge conflict
|
||||||
|
resolution leave behind old files.
|
||||||
|
|
||||||
-- Joey Hess <joeyh@debian.org> Wed, 09 Jul 2014 23:29:21 -0400
|
-- Joey Hess <joeyh@debian.org> Wed, 09 Jul 2014 23:29:21 -0400
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue