Skip to content
This repository was archived by the owner on Apr 12, 2019. It is now read-only.
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions repo_pull.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,8 @@ func (repo *Repository) GetPullRequestInfo(basePath, baseBranch, headBranch stri
func (repo *Repository) GetPatch(base, head string) ([]byte, error) {
return NewCommand("diff", "-p", "--binary", base, head).RunInDirBytes(repo.Path)
}

// GetFormatPatch generates and returns format-patch data between given revisions.
func (repo *Repository) GetFormatPatch(base, head string) (string, error) {
return NewCommand("format-patch", "--stdout", base + "..." + head).RunInDir(repo.Path)
}