From: Joey Hess Date: Thu, 21 Aug 2025 20:35:51 +0000 (-0400) Subject: update test suite for change X-Git-Tag: archive/raspbian/10.20251029-1+rpi1~1^2~3^2~191 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=e27b3b441146a822d9423cbe6161d73ed65cf829;p=git-annex.git update test suite for change fd89e611b2310b46368c91bcd79999b0ba8462a3 changed the exit code of git-annex sync which broke the test suite I'm actually a bit surprised that this test's export works after the sync fails. huh --- diff --git a/Test.hs b/Test.hs index 2fb6d6a03b..bf09dd7d55 100644 --- a/Test.hs +++ b/Test.hs @@ -2085,7 +2085,12 @@ test_export_import = intmpclonerepo $ do removeWhenExistsWith removeFile (literalOsPath "import") writecontent "import" (content "newimport3") git_annex "add" ["import"] "add of import" - commitchanges + ifM onAdjustedBranch + -- On an adjusted branch, sync fails when there is a merge + -- commit in history. + ( git_annex_shouldfail "sync" commitchangesparams "sync" + , commitchanges + ) git_annex "export" [origbranch, "--to", "foo"] "export after import conflict" dircontains "import" (content "newimport3") where @@ -2097,7 +2102,8 @@ test_export_import = intmpclonerepo $ do -- When on an adjusted branch, this updates the master branch -- to match it, which is necessary since the master branch is going -- to be exported. - commitchanges = git_annex "sync" ["--no-pull", "--no-push", "--no-content"] "sync" + commitchanges = git_annex "sync" commitchangesparams "sync" + commitchangesparams = ["--no-pull", "--no-push", "--no-content"] test_export_import_subdir :: Assertion test_export_import_subdir = intmpclonerepo $ do diff --git a/Test/Framework.hs b/Test/Framework.hs index a0dd710522..09ffe0a26d 100644 --- a/Test/Framework.hs +++ b/Test/Framework.hs @@ -535,6 +535,9 @@ testMode opts v = TestMode hasUnlockedFiles :: TestMode -> Bool hasUnlockedFiles m = unlockedFiles m || adjustedUnlockedBranch m +onAdjustedBranch :: IO Bool +onAdjustedBranch = adjustedUnlockedBranch <$> getTestMode + withTestMode :: TestMode -> TestTree -> TestTree withTestMode testmode = withResource prepare release . const where