Skip to content

Commit

Permalink
adding ssh upstream remote option for release update cmd
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholasSUSE committed Jan 22, 2025
1 parent 3d61869 commit 3845b72
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 3845b72

Please sign in to comment.