import qualified Annex.CatFile
import qualified Annex.Path
import qualified Annex.VectorClock
+import qualified Annex.VariantFile
import qualified Annex.AdjustedBranch
import qualified Annex.View
import qualified Annex.View.ViewedFile
checkmerge "r2" r2
conflictor = "conflictor"
subfile = conflictor </> "subfile"
- variantprefix = conflictor ++ ".variant"
checkmerge what d = do
doesDirectoryExist (d </> conflictor)
@? (d ++ " conflictor directory missing")
l <- getDirectoryContents d
- let v = filter (variantprefix `isPrefixOf`) l
+ let v = filter (Annex.VariantFile.variantMarker `isInfixOf`) l
not (null v)
@? (what ++ " conflictor variant file missing in: " ++ show l )
length v == 1
--- /dev/null
+[[!comment format=mdwn
+ username="joey"
+ subject="""comment 2"""
+ date="2021-11-22T16:32:10Z"
+ content="""
+The difference in behavior, when there's a conflict between a directory and a
+file, is that the recursive strategy leaves the directory in "added by them"
+conflict state, as well as adding the file with a different name
+(and oddly, not staging it at all), while
+the ort strategy leaves does not flag the directory as in conflict,
+and makes the file be in "added by them" conflict state.
+
+`git-annex sync` resolves such a conflict adequately, with the new version
+of git, but the name of the file turns out different, eg
+"foo~refs_remotes_origin_master.variant-b66a"
+or "foo~HEAD.variant-b66a" rather than
+"foo.variant-b66a". That happens only in such a mixed conflict,
+a conflict between two annexed files still gets the shorter name
+like "foo.variant-b66a".
+
+There's a small problem with a lack of a stable name being used, as shown
+above the name of the branch being merged from or to is used by git as part
+of the filename. So two people who resolve a merge this way would end up
+with two different names for the file. git-annex's merge conflict
+resolution is designed to yield a stable result no matter where it's run,
+so this behavior is a bit of a shame, but it's git's decision to behave
+that way, and I guess the same thing can happen when not using git-annex,
+if you commit what the new resolver stages. So this can be considered not a
+git-annex problem.
+
+I've adjusted the mixed conflict resolution test to accept these new names
+while also still working with the old names. That fixes that one. The other
+test is still failing.
+"""]]