Skip to content

Commit 10aaf46

Browse files
authored
use the same ref to check branch existance and merge-base calculation (#601)
fix #577 Signed-off-by: Cyril Jouve <[email protected]>
1 parent c1b0316 commit 10aaf46

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

pkg/chart/chart.go

+4-3
Original file line numberDiff line numberDiff line change
@@ -722,11 +722,12 @@ func (t *Testing) computeMergeBase() (string, error) {
722722
return "", errors.New("must be in a git repository")
723723
}
724724

725-
if !t.git.BranchExists(t.config.TargetBranch) {
726-
return "", fmt.Errorf("targetBranch '%s' does not exist", t.config.TargetBranch)
725+
branch := fmt.Sprintf("%s/%s", t.config.Remote, t.config.TargetBranch)
726+
if !t.git.BranchExists(branch) {
727+
return "", fmt.Errorf("targetBranch '%s' does not exist", branch)
727728
}
728729

729-
return t.git.MergeBase(fmt.Sprintf("%s/%s", t.config.Remote, t.config.TargetBranch), t.config.Since)
730+
return t.git.MergeBase(branch, t.config.Since)
730731
}
731732

732733
// ComputeChangedChartDirectories takes the merge base of HEAD and the configured remote and target branch and computes a

0 commit comments

Comments
 (0)