forked from forgejo/forgejo
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 <1012112796@qq.com> * Update modules/git/commit.go Co-authored-by: Lauris BH <lauris@nix.lv> * Update models/issue_comment.go Co-authored-by: Lauris BH <lauris@nix.lv> * fix lint Co-authored-by: Lauris BH <lauris@nix.lv>
This commit is contained in:
parent
8aef7aefd0
commit
ae20de7771
2 changed files with 98 additions and 12 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue