Skip to content

Commit

Permalink
Merge pull request #1116 from saschagrunert/rm-owner
Browse files Browse the repository at this point in the history
Remove `owner` from git.CloneOrOpenDefaultGitHubRepoSSH function
  • Loading branch information
k8s-ci-robot authored Feb 20, 2020
2 parents 11f0f14 + 0fe0cd7 commit 3c23261
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
6 changes: 2 additions & 4 deletions cmd/krel/cmd/ff.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import (
type ffOptions struct {
branch string
masterRef string
org string
}

var ffOpts = &ffOptions{}
Expand All @@ -54,7 +53,6 @@ var ffCmd = &cobra.Command{
func init() {
ffCmd.PersistentFlags().StringVar(&ffOpts.branch, "branch", "", "branch")
ffCmd.PersistentFlags().StringVar(&ffOpts.masterRef, "ref", kgit.DefaultMasterRef, "ref on master")
ffCmd.PersistentFlags().StringVar(&ffOpts.org, "org", kgit.DefaultGithubOrg, "org to run tool against")

rootCmd.AddCommand(ffCmd)
}
Expand All @@ -68,7 +66,7 @@ func runFf(opts *ffOptions) error {
remoteMaster := kgit.Remotify(kgit.Master)

logrus.Infof("Preparing to fast-forward master@%s onto the %s branch", masterRef, branch)
repo, err := kgit.CloneOrOpenDefaultGitHubRepoSSH(rootOpts.repoPath, opts.org)
repo, err := kgit.CloneOrOpenDefaultGitHubRepoSSH(rootOpts.repoPath)
if err != nil {
return err
}
Expand Down Expand Up @@ -137,7 +135,7 @@ func runFf(opts *ffOptions) error {
return err
}

prepushMessage(repo.Dir(), kgit.DefaultRemote, branch, opts.org, releaseRev, headRev)
prepushMessage(repo.Dir(), kgit.DefaultRemote, branch, kgit.DefaultGithubOrg, releaseRev, headRev)

_, pushUpstream, err := util.Ask("Are you ready to push the local branch fast-forward changes upstream? Please only answer after you have validated the changes.", "yes", 3)
if err != nil {
Expand Down
9 changes: 6 additions & 3 deletions pkg/git/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,12 @@ func (r *Repo) SetInnerRepo(repo Repository) {
}

// CloneOrOpenDefaultGitHubRepoSSH clones the default Kubernetes GitHub
// repository into the path or updates it.
func CloneOrOpenDefaultGitHubRepoSSH(repoPath, owner string) (*Repo, error) {
return CloneOrOpenGitHubRepo(repoPath, owner, DefaultGithubRepo, true)
// repository via SSH if the repoPath is empty, otherwise updates it at the
// expected repoPath.
func CloneOrOpenDefaultGitHubRepoSSH(repoPath string) (*Repo, error) {
return CloneOrOpenGitHubRepo(
repoPath, DefaultGithubOrg, DefaultGithubRepo, true,
)
}

// CloneOrOpenGitHubRepo creates a temp directory containing the provided
Expand Down

0 comments on commit 3c23261

Please sign in to comment.