diff options
author | Cirno the Strongest <1447794+CirnoT@users.noreply.github.com> | 2020-06-11 01:00:39 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-10 19:00:39 -0400 |
commit | 4a4977a1f0232bcef474495b8e2e2b4e3ce12c49 (patch) | |
tree | 61841d14653de6dcac0a47e6da74ff1e833f5701 | |
parent | a05a30c1c18186519002b1367bcd74512a08b89b (diff) | |
download | gitea-4a4977a1f0232bcef474495b8e2e2b4e3ce12c49.tar.gz gitea-4a4977a1f0232bcef474495b8e2e2b4e3ce12c49.zip |
Don't consider tag refs as valid for branch name (#11847)
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
-rw-r--r-- | modules/git/commit.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/git/commit.go b/modules/git/commit.go index 61428d23a4..a114c902dd 100644 --- a/modules/git/commit.go +++ b/modules/git/commit.go @@ -468,7 +468,7 @@ func (c *Commit) GetSubModule(entryname string) (*SubModule, error) { // GetBranchName gets the closes branch name (as returned by 'git name-rev --name-only') func (c *Commit) GetBranchName() (string, error) { - data, err := NewCommand("name-rev", "--name-only", "--no-undefined", c.ID.String()).RunInDir(c.repo.Path) + data, err := NewCommand("name-rev", "--exclude", "refs/tags/*", "--name-only", "--no-undefined", c.ID.String()).RunInDir(c.repo.Path) if err != nil { // handle special case where git can not describe commit if strings.Contains(err.Error(), "cannot describe") { |