fix bug about can't skip commits base on base branch (#11555)

* fix bug about can't skip commits base on base branch

Signed-off-by: a1012112796 <[email protected]>

* Update modules/git/commit.go

Co-authored-by: Lauris BH <[email protected]>

* Update models/issue_comment.go

Co-authored-by: Lauris BH <[email protected]>

* fix lint

Co-authored-by: Lauris BH <[email protected]>
This commit is contained in:
赵智超
2020-06-24 20:40:52 +01:00
committed by GitHub
co-authored by GitHub Lauris BH
parent 8aef7aefd0
commit ae20de7771
2 changed files with 98 additions and 12 deletions
+10
View File
@@ -482,6 +482,16 @@ func (c *Commit) GetBranchName() (string, error) {
return strings.SplitN(strings.TrimSpace(data), "~", 2)[0], nil
}
// LoadBranchName load branch name for commit
func (c *Commit) LoadBranchName() (err error) {
if len(c.Branch) != 0 {
return
}
c.Branch, err = c.GetBranchName()
return
}
// GetTagName gets the current tag name for given commit
func (c *Commit) GetTagName() (string, error) {
data, err := NewCommand("describe", "--exact-match", "--tags", "--always", c.ID.String()).RunInDir(c.repo.Path)