mirror of
https://github.com/go-gitea/gitea
synced 2025-07-13 22:17:20 +00:00
[API] Pull Requests (#248)
This commit is contained in:
committed by
GitHub
parent
d7ed78a919
commit
0f05470cb8
@ -170,6 +170,22 @@ func (issue *Issue) HTMLURL() string {
|
||||
return fmt.Sprintf("%s/%s/%d", issue.Repo.HTMLURL(), path, issue.Index)
|
||||
}
|
||||
|
||||
// DiffURL returns the absolute URL to this diff
|
||||
func (issue *Issue) DiffURL() string {
|
||||
if issue.IsPull {
|
||||
return fmt.Sprintf("%s/pulls/%d.diff", issue.Repo.HTMLURL(), issue.Index)
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
// PatchURL returns the absolute URL to this patch
|
||||
func (issue *Issue) PatchURL() string {
|
||||
if issue.IsPull {
|
||||
return fmt.Sprintf("%s/pulls/%d.patch", issue.Repo.HTMLURL(), issue.Index)
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
// State returns string representation of issue status.
|
||||
func (issue *Issue) State() api.StateType {
|
||||
if issue.IsClosed {
|
||||
|
Reference in New Issue
Block a user