fix strange test failure
It was trying to git annex adjust when in a direct mode repo, and that of course fails. What I don't understand though, is how the test suite managed to work before, when it was clearly checking the wrong thing. Since the right way to fix it was obvious, I have not bisected. This work is supported by the NIH-funded NICEMAN (ReproNim TR&D3) project.
This commit is contained in:
parent
63cf3381f0
commit
94aa0e2f64
3 changed files with 13 additions and 8 deletions
|
@ -26,7 +26,7 @@ module Annex.AdjustedBranch (
|
||||||
propigateAdjustedCommits,
|
propigateAdjustedCommits,
|
||||||
AdjustedClone(..),
|
AdjustedClone(..),
|
||||||
checkAdjustedClone,
|
checkAdjustedClone,
|
||||||
isGitVersionSupported,
|
isSupported,
|
||||||
checkVersionSupported,
|
checkVersionSupported,
|
||||||
) where
|
) where
|
||||||
|
|
||||||
|
@ -610,10 +610,8 @@ checkAdjustedClone = ifM isBareRepo
|
||||||
, return NeedUpgradeForAdjustedClone
|
, return NeedUpgradeForAdjustedClone
|
||||||
)
|
)
|
||||||
|
|
||||||
-- git 2.2.0 needed for GIT_COMMON_DIR which is needed
|
isSupported :: Annex Bool
|
||||||
-- by updateAdjustedBranch to use withWorkTreeRelated.
|
isSupported = versionSupportsAdjustedBranch <&&> liftIO isGitVersionSupported
|
||||||
isGitVersionSupported :: IO Bool
|
|
||||||
isGitVersionSupported = not <$> Git.Version.older "2.2.0"
|
|
||||||
|
|
||||||
checkVersionSupported :: Annex ()
|
checkVersionSupported :: Annex ()
|
||||||
checkVersionSupported = do
|
checkVersionSupported = do
|
||||||
|
@ -621,3 +619,8 @@ checkVersionSupported = do
|
||||||
giveup "Adjusted branches are only supported in v6 or newer repositories."
|
giveup "Adjusted branches are only supported in v6 or newer repositories."
|
||||||
unlessM (liftIO isGitVersionSupported) $
|
unlessM (liftIO isGitVersionSupported) $
|
||||||
giveup "Your version of git is too old; upgrade it to 2.2.0 or newer to use adjusted branches."
|
giveup "Your version of git is too old; upgrade it to 2.2.0 or newer to use adjusted branches."
|
||||||
|
|
||||||
|
-- git 2.2.0 needed for GIT_COMMON_DIR which is needed
|
||||||
|
-- by updateAdjustedBranch to use withWorkTreeRelated.
|
||||||
|
isGitVersionSupported :: IO Bool
|
||||||
|
isGitVersionSupported = not <$> Git.Version.older "2.2.0"
|
||||||
|
|
6
Test.hs
6
Test.hs
|
@ -1098,7 +1098,7 @@ test_conflict_resolution =
|
||||||
|
|
||||||
{- Conflict resolution while in an adjusted branch. -}
|
{- Conflict resolution while in an adjusted branch. -}
|
||||||
test_conflict_resolution_adjusted_branch :: Assertion
|
test_conflict_resolution_adjusted_branch :: Assertion
|
||||||
test_conflict_resolution_adjusted_branch = whenM Annex.AdjustedBranch.isGitVersionSupported $
|
test_conflict_resolution_adjusted_branch = whenM (annexeval Annex.AdjustedBranch.isSupported) $
|
||||||
withtmpclonerepo $ \r1 ->
|
withtmpclonerepo $ \r1 ->
|
||||||
withtmpclonerepo $ \r2 -> do
|
withtmpclonerepo $ \r2 -> do
|
||||||
indir r1 $ do
|
indir r1 $ do
|
||||||
|
@ -1447,7 +1447,7 @@ test_mixed_lock_conflict_resolution =
|
||||||
- where the same file is added to both independently. The bad merge
|
- where the same file is added to both independently. The bad merge
|
||||||
- emptied the whole tree. -}
|
- emptied the whole tree. -}
|
||||||
test_adjusted_branch_merge_regression :: Assertion
|
test_adjusted_branch_merge_regression :: Assertion
|
||||||
test_adjusted_branch_merge_regression = whenM Annex.AdjustedBranch.isGitVersionSupported $
|
test_adjusted_branch_merge_regression = whenM (annexeval Annex.AdjustedBranch.isSupported) $
|
||||||
withtmpclonerepo $ \r1 ->
|
withtmpclonerepo $ \r1 ->
|
||||||
withtmpclonerepo $ \r2 -> do
|
withtmpclonerepo $ \r2 -> do
|
||||||
pair r1 r2
|
pair r1 r2
|
||||||
|
@ -1474,7 +1474,7 @@ test_adjusted_branch_merge_regression = whenM Annex.AdjustedBranch.isGitVersionS
|
||||||
- a subtree to an existing tree lost files. -}
|
- a subtree to an existing tree lost files. -}
|
||||||
test_adjusted_branch_subtree_regression :: Assertion
|
test_adjusted_branch_subtree_regression :: Assertion
|
||||||
test_adjusted_branch_subtree_regression =
|
test_adjusted_branch_subtree_regression =
|
||||||
whenM Annex.AdjustedBranch.isGitVersionSupported $
|
whenM (annexeval Annex.AdjustedBranch.isSupported) $
|
||||||
withtmpclonerepo $ \r -> do
|
withtmpclonerepo $ \r -> do
|
||||||
indir r $ do
|
indir r $ do
|
||||||
disconnectOrigin
|
disconnectOrigin
|
||||||
|
|
|
@ -38,3 +38,5 @@ Full log http://www.onerussian.com/tmp/git-annex_6.20181011+git109-gff9ba1f4d-1~
|
||||||
(not sure if relevant - this is I think the first build without my custom no LOCPATH patch)
|
(not sure if relevant - this is I think the first build without my custom no LOCPATH patch)
|
||||||
|
|
||||||
[[!meta author=yoh]]
|
[[!meta author=yoh]]
|
||||||
|
|
||||||
|
> [[fixed|done]] --[[Joey]]
|
||||||
|
|
Loading…
Reference in a new issue