Skip to content

Commit

Permalink
use the same ref to check branch existance and merge-base calculation (
Browse files Browse the repository at this point in the history
…#601)

fix #577

Signed-off-by: Cyril Jouve <[email protected]>
  • Loading branch information
jouve authored Oct 27, 2023
1 parent c1b0316 commit 10aaf46
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pkg/chart/chart.go
Original file line number Diff line number Diff line change
Expand Up @@ -722,11 +722,12 @@ func (t *Testing) computeMergeBase() (string, error) {
return "", errors.New("must be in a git repository")
}

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

return t.git.MergeBase(fmt.Sprintf("%s/%s", t.config.Remote, t.config.TargetBranch), t.config.Since)
return t.git.MergeBase(branch, t.config.Since)
}

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

0 comments on commit 10aaf46

Please sign in to comment.