Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Properly handle and return empty string for dangling commits in GetBranchName #11587

Merged
merged 1 commit into from
May 23, 2020

Conversation

CirnoT
Copy link
Contributor

@CirnoT CirnoT commented May 23, 2020

Run git command in GetBranchName with --no-undefined and handle case where git cannot describe dangling commit by returning empty branch name, instead of relying on git returning us "undefined".

This also fixes:

  • Recently introduced commit history on PR view for "undefined" branch name
  • Do not show "undefined" in commit view as branch name for dangling commits

Ref: https://git-scm.com/docs/git-name-rev

@GiteaBot GiteaBot added the lgtm/need 1 This PR needs approval from one additional maintainer to be merged. label May 23, 2020
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels May 23, 2020
@zeripath zeripath added this to the 1.13.0 milestone May 23, 2020
@zeripath zeripath merged commit 31df012 into go-gitea:master May 23, 2020
@CirnoT CirnoT deleted the undefined branch May 23, 2020 22:20
ydelafollye pushed a commit to ydelafollye/gitea that referenced this pull request Jul 31, 2020
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants