mirror of
https://github.com/go-gitea/gitea
synced 2025-12-07 13:28:25 +00:00
Display forked repository's branch
This commit is contained in:
@@ -21,13 +21,13 @@ const (
|
||||
)
|
||||
|
||||
type IssueDevLink struct {
|
||||
ID int64 `xorm:"pk autoincr"`
|
||||
IssueID int64 `xorm:"INDEX"`
|
||||
LinkType IssueDevLinkType
|
||||
LinkedRepoID int64 `xorm:"INDEX"` // it can link to self repo or other repo
|
||||
LinkIndex string // branch name, pull request number or commit sha
|
||||
CreatedUnix timeutil.TimeStamp `xorm:"INDEX created"`
|
||||
|
||||
ID int64 `xorm:"pk autoincr"`
|
||||
IssueID int64 `xorm:"INDEX"`
|
||||
LinkType IssueDevLinkType
|
||||
LinkedRepoID int64 `xorm:"INDEX"` // it can link to self repo or other repo
|
||||
LinkIndex string // branch name, pull request number or commit sha
|
||||
CreatedUnix timeutil.TimeStamp `xorm:"INDEX created"`
|
||||
Repo *repo_model.Repository `xorm:"-"` // current repo of issue
|
||||
LinkedRepo *repo_model.Repository `xorm:"-"`
|
||||
PullRequest *PullRequest `xorm:"-"`
|
||||
Branch *git_model.Branch `xorm:"-"`
|
||||
@@ -38,6 +38,13 @@ func init() {
|
||||
db.RegisterModel(new(IssueDevLink))
|
||||
}
|
||||
|
||||
func (i *IssueDevLink) BranchFullName() string {
|
||||
if i.Repo.ID == i.LinkedRepo.ID {
|
||||
return i.Branch.Name
|
||||
}
|
||||
return i.LinkedRepo.FullName() + ":" + i.Branch.Name
|
||||
}
|
||||
|
||||
// IssueDevLinks represents a list of issue development links
|
||||
type IssueDevLinks []*IssueDevLink
|
||||
|
||||
|
||||
Reference in New Issue
Block a user