Detect buildpacks for specific branch (fall back to deploy-branch to be consistent with deployment behavior)

This commit is contained in:
Tasos Maschalidis committed 2025-10-16 18:33:47 +03:00
1 parent e234401178
commit 65e0fb9037
4 files changed
+20 -6

No files matched your search

+12 -2
View File
@@ -64,15 +64,25 @@ func validBuildpackURL(buildpack string) (string, error) {
return buildpack, fmt.Errorf("Invalid buildpack specified: %v", buildpack)
}
func checkoutBareGitRepo(sourceWorkDir string) (string, error) {
func checkoutBareGitRepo(sourceWorkDir string, branch string) (string, error) {
tmpdir, err := os.MkdirTemp("", "bare-git-checkout")
if err != nil {
return "", fmt.Errorf("Unable to create temporary directory: %s", err.Error())
}
args := []string{
"--git-dir=" + sourceWorkDir,
"--work-tree=" + tmpdir,
"checkout", "-f",
}
if branch != "" {
args = append(args, branch)
}
result, err := common.CallExecCommand(common.ExecCommandInput{
Command: "git",
Args: []string{"--git-dir=" + sourceWorkDir, "--work-tree=" + tmpdir, "checkout", "-f"},
Args: args,
})
if err != nil {