fix test failure with git version 2.34.0

The new "ort" resolver uses different filenames than what the test suite
accepted when resolving a conflict between a directory an an annexed
file. Make the test looser in what it accepts, so it will work with old
and new git.

Other tests still look for "conflictor.variant" as a prefix,
because when eg resolving a conflicted merge of 2 annexed files,
the filename is not changed by the ort resolver, and I didn't want to
unncessarily loosen the test.

Also I'm not entirely happy with the filenames used by the ort resolver,
see comment.

There's still another test failure caused by that resolver that is not
fixed yet.
This commit is contained in:
Joey Hess 2021-11-22 13:28:20 -04:00
parent e2da89ba49
commit c49787824c
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
2 changed files with 36 additions and 2 deletions

View file

@ -64,6 +64,7 @@ import qualified Annex.Init
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
@ -1369,12 +1370,11 @@ test_mixed_conflict_resolution = do
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