Formats repo
This commit is contained in:
+7
-5
@@ -41,8 +41,9 @@ rawGit args = do
|
||||
testLogger :: IO Logger
|
||||
testLogger = Logger <$> newMVar ()
|
||||
|
||||
-- | Create a temporary git repository, configure a user, make an initial
|
||||
-- commit on branch "main", run the action with the repo path, then clean up.
|
||||
{- | Create a temporary git repository, configure a user, make an initial
|
||||
commit on branch "main", run the action with the repo path, then clean up.
|
||||
-}
|
||||
withTempGitRepo :: (FilePath -> IO a) -> IO a
|
||||
withTempGitRepo action = withSystemTempDirectory "converge-test" $ \tmp -> do
|
||||
let repo = tmp </> "repo"
|
||||
@@ -56,9 +57,10 @@ withTempGitRepo action = withSystemTempDirectory "converge-test" $ \tmp -> do
|
||||
_ <- runGitIn repo ["commit", "-m", "initial commit"]
|
||||
action repo
|
||||
|
||||
-- | Create a temporary git repo with a bare remote, run the action with the
|
||||
-- local repo path, then clean up. The local repo is pushed to the remote
|
||||
-- so origin/main is reachable via fetch/pull.
|
||||
{- | Create a temporary git repo with a bare remote, run the action with the
|
||||
local repo path, then clean up. The local repo is pushed to the remote
|
||||
so origin/main is reachable via fetch/pull.
|
||||
-}
|
||||
withTempGitRepoWithRemote :: (FilePath -> IO a) -> IO a
|
||||
withTempGitRepoWithRemote action = withSystemTempDirectory "converge-test-remote" $ \tmp -> do
|
||||
let remoteDir = tmp </> "remote.git"
|
||||
|
||||
Reference in New Issue
Block a user