diff --git a/tools/git-adapter/src/commonMain/kotlin/com/zegreatrob/tools/adapter/git/GitAdapter.kt b/tools/git-adapter/src/commonMain/kotlin/com/zegreatrob/tools/adapter/git/GitAdapter.kt index 1b8c1b9..6308816 100644 --- a/tools/git-adapter/src/commonMain/kotlin/com/zegreatrob/tools/adapter/git/GitAdapter.kt +++ b/tools/git-adapter/src/commonMain/kotlin/com/zegreatrob/tools/adapter/git/GitAdapter.kt @@ -195,6 +195,10 @@ class GitAdapter(private val workingDirectory: String) { fun addRemote(name: String, url: String) { runProcess(listOf("git", "remote", "add", name, url), workingDirectory) } + + fun fetch() { + runProcess(listOf("git", "fetch"), workingDirectory) + } } data class GitStatus( diff --git a/tools/git-test/src/jvmMain/kotlin/com/zegreatrob/tools/test/git/GitHelper.kt b/tools/git-test/src/jvmMain/kotlin/com/zegreatrob/tools/test/git/GitHelper.kt index 937dfde..8742c82 100644 --- a/tools/git-test/src/jvmMain/kotlin/com/zegreatrob/tools/test/git/GitHelper.kt +++ b/tools/git-test/src/jvmMain/kotlin/com/zegreatrob/tools/test/git/GitHelper.kt @@ -32,10 +32,9 @@ fun initializeGitRepo( gitAdapter.newAnnotatedTag(initialTag, "HEAD", "Funky Testerson", "funk@test.io") } } - gitAdapter.addRemote(name = "origin", url = remoteUrl) + gitAdapter.fetch() val grgit = Grgit.open(mapOf("dir" to directory)) - grgit.pull() grgit.branch.change( fun BranchChangeOp.() { this.name = "master"