add test case for readonly remote

Tests for the reversion fixed in 837116ef1e
and similar problems.

Sponsored-by: Dartmouth College's Datalad project
This commit is contained in:
Joey Hess 2021-08-30 16:39:02 -04:00
parent 249d424b8a
commit ccf7e5b949
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
2 changed files with 28 additions and 8 deletions

View file

@ -631,3 +631,12 @@ origBranch :: Types.Annex String
origBranch = maybe "foo"
(Git.Types.fromRef . Git.Ref.base . Annex.AdjustedBranch.fromAdjustedBranch)
<$> Annex.inRepo Git.Branch.current
{- Set up repos as remotes of each other. -}
pair :: FilePath -> FilePath -> Assertion
pair r1 r2 = forM_ [r1, r2] $ \r -> indir r $ do
when (r /= r1) $
git "remote" ["add", "r1", "../../" ++ r1] "remote add"
when (r /= r2) $
git "remote" ["add", "r2", "../../" ++ r2] "remote add"