Merge pull request '增加commit详情页分支信息' (#44) from develop into master
This commit is contained in:
commit
72ac212a9f
|
@ -144,6 +144,7 @@ func ToCommit(repo *models.Repository, commit *git.Commit, userCache map[string]
|
|||
})
|
||||
}
|
||||
}
|
||||
commit.LoadBranchName()
|
||||
|
||||
return &api.Commit{
|
||||
CommitDate: commit.Committer.When.Format("2006-01-02"), // new time format, year-moon-day
|
||||
|
@ -178,5 +179,6 @@ func ToCommit(repo *models.Repository, commit *git.Commit, userCache map[string]
|
|||
Committer: apiCommitter,
|
||||
Parents: apiParents,
|
||||
Files: affectedFileList,
|
||||
Branch: commit.Branch,
|
||||
}, nil
|
||||
}
|
||||
|
|
|
@ -49,6 +49,7 @@ type Commit struct {
|
|||
Parents []*CommitMeta `json:"parents"`
|
||||
Files []*CommitAffectedFiles `json:"files"`
|
||||
CommitDate string `json:"commit_date"`
|
||||
Branch string `json:"branch"`
|
||||
}
|
||||
|
||||
// CommitDateOptions store dates for GIT_AUTHOR_DATE and GIT_COMMITTER_DATE
|
||||
|
|
|
@ -1387,8 +1387,6 @@ func GetPullFiles(ctx *context.APIContext) {
|
|||
|
||||
pr, err := models.GetPullRequestByIndex(ctx.Repo.Repository.ID, ctx.ParamsInt64(":index"))
|
||||
issue := pr.Issue
|
||||
// issue := checkPullInfo(ctx.Context)
|
||||
log.Info("issue %s", issue)
|
||||
if issue == nil {
|
||||
ctx.NotFound("checkPullInfo", nil)
|
||||
|
||||
|
|
|
@ -13268,6 +13268,10 @@
|
|||
"author": {
|
||||
"$ref": "#/definitions/User"
|
||||
},
|
||||
"branch": {
|
||||
"type": "string",
|
||||
"x-go-name": "Branch"
|
||||
},
|
||||
"commit": {
|
||||
"$ref": "#/definitions/RepoCommit"
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue