Skip to content

Commit

Permalink
Merge pull request #161 from nicholasSUSE/fix-ssh-remote
Browse files Browse the repository at this point in the history
adding ssh upstream remote option for release update cmd
  • Loading branch information
nicholasSUSE authored Jan 22, 2025
2 parents 3d61869 + 3845b72 commit ecd8dd6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/git/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,9 @@ func (g *Git) DeleteBranch(branch string) error {
// CheckFileExists checks if a file exists in the git repository for a specific branch
func (g *Git) CheckFileExists(file, branch string) error {
upstreamRemote := g.Remotes["https://github.com/rancher/charts"]
if upstreamRemote == "" {
upstreamRemote = g.Remotes["git@github.com:rancher/charts.git"]
}
target := upstreamRemote + "/" + branch + ":" + file
return exec.Command("git", "-C", g.Dir, "cat-file", "-e", target).Run()
}
Expand Down

0 comments on commit ecd8dd6

Please sign in to comment.