Skip to content

Commit

Permalink
Update function calls
Browse files Browse the repository at this point in the history
  • Loading branch information
ethantkoenig committed May 28, 2017
1 parent d5e180e commit db148a4
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 7 deletions.
5 changes: 4 additions & 1 deletion models/pull.go
Original file line number Diff line number Diff line change
Expand Up @@ -907,7 +907,10 @@ func (pr *PullRequest) PushToBaseRepo() (err error) {

_ = os.Remove(file)

if err = git.Push(headRepoPath, tmpRemoteName, fmt.Sprintf("%s:%s", pr.HeadBranch, headFile)); err != nil {
if err = git.Push(headRepoPath, git.PushOptions{
Remote: tmpRemoteName,
Branch: fmt.Sprintf("%s:%s", pr.HeadBranch, headFile),
}); err != nil {
return fmt.Errorf("Push: %v", err)
}

Expand Down
5 changes: 4 additions & 1 deletion models/repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -2342,7 +2342,10 @@ func (repo *Repository) CreateNewBranch(doer *User, oldBranchName, branchName st
return fmt.Errorf("CreateNewBranch: %v", err)
}

if err = git.Push(localPath, "origin", branchName); err != nil {
if err = git.Push(localPath, git.PushOptions{
Remote: "origin",
Branch: branchName,
}); err != nil {
return fmt.Errorf("Push: %v", err)
}

Expand Down
15 changes: 12 additions & 3 deletions models/repo_editor.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,10 @@ func (repo *Repository) UpdateRepoFile(doer *User, opts UpdateRepoFileOptions) (
Message: opts.Message,
}); err != nil {
return fmt.Errorf("CommitChanges: %v", err)
} else if err = git.Push(localPath, "origin", opts.NewBranch); err != nil {
} else if err = git.Push(localPath, git.PushOptions{
Remote: "origin",
Branch: opts.NewBranch,
}); err != nil {
return fmt.Errorf("git push origin %s: %v", opts.NewBranch, err)
}

Expand Down Expand Up @@ -273,7 +276,10 @@ func (repo *Repository) DeleteRepoFile(doer *User, opts DeleteRepoFileOptions) (
Message: opts.Message,
}); err != nil {
return fmt.Errorf("CommitChanges: %v", err)
} else if err = git.Push(localPath, "origin", opts.NewBranch); err != nil {
} else if err = git.Push(localPath, git.PushOptions{
Remote: "origin",
Branch: opts.NewBranch,
}); err != nil {
return fmt.Errorf("git push origin %s: %v", opts.NewBranch, err)
}

Expand Down Expand Up @@ -509,7 +515,10 @@ func (repo *Repository) UploadRepoFiles(doer *User, opts UploadRepoFileOptions)
Message: opts.Message,
}); err != nil {
return fmt.Errorf("CommitChanges: %v", err)
} else if err = git.Push(localPath, "origin", opts.NewBranch); err != nil {
} else if err = git.Push(localPath, git.PushOptions{
Remote: "origin",
Branch: opts.NewBranch,
}); err != nil {
return fmt.Errorf("git push origin %s: %v", opts.NewBranch, err)
}

Expand Down
10 changes: 8 additions & 2 deletions models/wiki.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,10 @@ func (repo *Repository) updateWikiPage(doer *User, oldWikiPath, wikiPath, conten
Message: message,
}); err != nil {
return fmt.Errorf("CommitChanges: %v", err)
} else if err = git.Push(localPath, "origin", "master"); err != nil {
} else if err = git.Push(localPath, git.PushOptions{
Remote: "origin",
Branch: "master",
}); err != nil {
return fmt.Errorf("Push: %v", err)
}

Expand Down Expand Up @@ -209,7 +212,10 @@ func (repo *Repository) DeleteWikiPage(doer *User, wikiPath string) (err error)
Message: message,
}); err != nil {
return fmt.Errorf("CommitChanges: %v", err)
} else if err = git.Push(localPath, "origin", "master"); err != nil {
} else if err = git.Push(localPath, git.PushOptions{
Remote: "origin",
Branch: "master",
}); err != nil {
return fmt.Errorf("Push: %v", err)
}

Expand Down

0 comments on commit db148a4

Please sign in to comment.