Use master branch in patch dirs (#450)

use `master` as a branch name instead of `Yatopia-api` or `Yatopia-server` in `Yatopia-API` and `Yatopia-Server` respectively.
This commit is contained in:
Simon Gardling 2021-04-05 18:44:30 -04:00 committed by GitHub
parent 679a88af3f
commit 16ba48ea61
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 9 deletions

View File

@ -87,8 +87,10 @@ internal fun Project.createApplyPatchesTask(
if (applyPatches(patchDir, upstream.name, name, wasGitSigningEnabled, projectDir)) continue
}
project.gitCmd("branch", "-D", "$forkName-$folder", dir = projectDir)
project.gitCmd("checkout", "-b", "$forkName-$folder", dir = projectDir)
// project.gitCmd("branch", "-D", "$forkName-$folder", dir = projectDir)
// project.gitCmd("checkout", "-b", "$forkName-$folder", dir = projectDir)
project.gitCmd("branch", "-D", "master", dir = projectDir)
project.gitCmd("checkout", "-b", "master", dir = projectDir)
val patchDir = patchesDir.toPath()
// Apply patches
if (applyPatches(patchDir, forkName, name, wasGitSigningEnabled, projectDir)) continue

View File

@ -19,7 +19,8 @@ internal fun Project.createFixBranchesTask(
doLast {
for (folder in folderArray) {
val subprojectWorkDir = Paths.get("${toothpick.forkName}-${if (folder == "api") {"API"} else {"Server"}}").toFile()
val currentBranchCommits = gitCmd("--no-pager", "log", "${toothpick.forkName}-$folder...${toothpick.upstreamBranch}", "--pretty=oneline",
// val currentBranchCommits = gitCmd("--no-pager", "log", "${toothpick.forkName}-$folder...${toothpick.upstreamBranch}", "--pretty=oneline",
val currentBranchCommits = gitCmd("--no-pager", "log", "master...${toothpick.upstreamBranch}", "--pretty=oneline",
dir = subprojectWorkDir).output.toString()
val nameMap = ConcurrentHashMap<String, String>()
for (upstream in upstreams) {
@ -46,7 +47,8 @@ internal fun Project.createFixBranchesTask(
ensureSuccess(gitCmd("reset", "--hard", nameMap.get(branchName) as String, dir = subprojectWorkDir,
printOut = true))
}
ensureSuccess(gitCmd("checkout", "${toothpick.forkName}-$folder", dir = subprojectWorkDir,
// ensureSuccess(gitCmd("checkout", "${toothpick.forkName}-$folder", dir = subprojectWorkDir,
ensureSuccess(gitCmd("checkout", "master", dir = subprojectWorkDir,
printOut = true))
}
}

View File

@ -32,7 +32,8 @@ internal fun Project.createRebuildPatchesTask(
updatePatches(patchPath, upstream.name, folder, projectDir, previousUpstreamName)
previousUpstreamName = "${upstream.name}-$folder"
}
ensureSuccess(gitCmd("checkout", "$forkName-$folder", dir = projectDir,
// ensureSuccess(gitCmd("checkout", "$forkName-$folder", dir = projectDir,
ensureSuccess(gitCmd("checkout", "master", dir = projectDir,
printOut = true))
updatePatches(patchesDir, toothpick.forkName, folder, projectDir, previousUpstreamName)
@ -59,10 +60,17 @@ private fun Project.updatePatches(
?.forEach { it -> it.delete() }
ensureSuccess(
gitCmd(
"checkout", "$name-$folder", dir = projectDir,
printOut = true
)
if (name != "Yatopia") {
gitCmd(
"checkout", "$name-$folder", dir = projectDir,
printOut = true
)
} else {
gitCmd(
"checkout", "master", dir = projectDir,
printOut = true
)
}
)
ensureSuccess(
gitCmd(