Skip to content

fix: handle git branch name with special chars correctly - #39483

Open
wxiaoguang wants to merge 5 commits into
go-gitea:mainfrom
wxiaoguang:fix-git-branch-name
Open

wxiaoguang wants to merge 5 commits into
go-gitea:mainfrom
wxiaoguang:fix-git-branch-name

Conversation

@wxiaoguang

Copy link
Copy Markdown
Contributor

Fix the bugs:

  • Commit graph page doesn't show
  • PR command line instructions are wrong

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Sep 30, 2026
@wxiaoguang

wxiaoguang commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor Author

Before

image
image

After

image
image

@wxiaoguang wxiaoguang added this to the 29.0.0 milestone Sep 30, 2026
@wxiaoguang wxiaoguang added the backport/v28 This PR should be backported to Gitea 28 label Sep 30, 2026
@wxiaoguang
wxiaoguang requested a balanced review from Copilot September 30, 2026 08:08

This comment was marked as resolved.

This comment was marked as outdated.

go-shellquote escapes "{" but not "}", so a branch like "x{a}" becomes
"x\{a}", which zsh rejects with a parse error. util.ShellEscape
double-quotes such names instead.

Neither quoted a leading "#", so a branch like "go-gitea#123" turned the rest
of each command into a shell comment, making the instructions silently
do nothing.

Assisted-by: Claude Code:claude-opus-5-5

@silverwind silverwind left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

used shared helper in 51d2f8c and added fixed on case with comments there.

@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Sep 30, 2026
@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 Sep 30, 2026
@bircni bircni modified the milestones: 29.0.0, 28.0.1 Sep 30, 2026
@bircni
bircni enabled auto-merge (squash) September 30, 2026 19:42
@bircni bircni added the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Sep 30, 2026
@silverwind

Copy link
Copy Markdown
Member

https://github.com/go-gitea/gitea/actions/runs/36767498639/job/110065310088 is a unrelated mssql deadlock, checking.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport/v28 This PR should be backported to Gitea 28 lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. type/bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants