Skip to content

Commit

Permalink
fix: update for config
Browse files Browse the repository at this point in the history
  • Loading branch information
phodal committed Dec 8, 2023
1 parent 58139f3 commit 72110e5
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
1 change: 1 addition & 0 deletions pipeline/checkout/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.tmp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class GitCommandManager(var workingDirectory: String = ".", private var lfs: Boo
private val exec = Command()

fun init(): GitOutput {
return execGit(listOf("init", "."))
return execGit(listOf("init", workingDirectory))
}

fun remoteAdd(remoteName: String, remoteUrl: String) {
Expand Down Expand Up @@ -208,6 +208,7 @@ class GitCommandManager(var workingDirectory: String = ".", private var lfs: Boo
} else {
listOf("log", "-1")
}

val silent = format != null
return execGit(args, false, silent)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package org.archguard.action.checkout

import org.archguard.action.exec.CommandArgs
import org.archguard.action.exec.CommandSetting
import java.io.File.separator

class GitSourceSettings(
val repository: String,
Expand All @@ -17,8 +18,7 @@ class GitSourceSettings(
val gitServerUrl: String = "https://github.com"
val nestedSubmodules: Boolean = false
val commit: String = ""
val repositoryPath: String get() = repository.substringAfterLast("/")

var repositoryPath = workdir + separator + repository.substringAfterLast("/")
val persistCredentials: Boolean = false
val sshStrict: Boolean = false
val sshKnownHosts: String = ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,12 @@ class GitSourceSettingsTest {
val branch = "master"

val settings = GitSourceSettings.fromArgs(arrayOf("--repository", repository, "--branch", branch))
settings.repositoryPath = ".tmp/codedb"

settings.repository shouldBe repository
settings.branch shouldBe branch
// settings.repository shouldBe repository
// settings.branch shouldBe branch

val commandManager = GitCommandManager(settings.repositoryPath)
doCheckout(commandManager, settings)
}
}

0 comments on commit 72110e5

Please sign in to comment.