Skip to content

Commit 055819b

Browse files
authored
Merge pull request #1826 from scala-steward-org/topic/log-clone-sync
More accurately log when we're cloning and syncing
2 parents 5c8d4c2 + f2be19d commit 055819b

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

modules/core/src/main/scala/org/scalasteward/core/nurture/NurtureAlg.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ final class NurtureAlg[F[_]](config: Config)(implicit
6363

6464
def cloneAndSync(repo: Repo, fork: RepoOut): F[Branch] =
6565
for {
66-
_ <- logger.info(s"Clone and synchronize ${repo.show}")
6766
_ <- gitAlg.cloneExists(repo).ifM(F.unit, vcsRepoAlg.cloneAndSync(repo, fork))
6867
baseBranch <- vcsApiAlg.parentOrRepo(fork, config.doNotFork).map(_.default_branch)
6968
} yield baseBranch

modules/core/src/main/scala/org/scalasteward/core/vcs/VCSRepoAlg.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,11 @@ final class VCSRepoAlg[F[_]](config: Config)(implicit
3232
logger: Logger[F],
3333
F: MonadThrow[F]
3434
) {
35-
3635
def cloneAndSync(repo: Repo, repoOut: RepoOut): F[Unit] =
3736
for {
37+
_ <-
38+
if (config.doNotFork) logger.info(s"Clone ${repo.show}")
39+
else logger.info(s"Clone and synchronize ${repo.show}")
3840
_ <- clone(repo, repoOut)
3941
_ <- syncFork(repo, repoOut)
4042
_ <- logger.attemptLogError("Initializing and cloning submodules failed") {

modules/core/src/test/scala/org/scalasteward/core/vcs/VCSRepoAlgTest.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ class VCSRepoAlgTest extends FunSuite {
4343
envVars ++ List(repoDir, "git", "merge", "upstream/master"),
4444
envVars ++ List(repoDir, "git", "push", "--force", "--set-upstream", "origin", "master"),
4545
envVars ++ List(repoDir, "git", "submodule", "update", "--init", "--recursive")
46-
)
46+
),
47+
logs = Vector((None, "Clone and synchronize fthomas/datapackage"))
4748
)
4849
assertEquals(state, expected)
4950
}

0 commit comments

Comments
 (0)