Dont count on magic value "master" for the git backend #11806

Closed
opened 2025-11-02 09:48:20 -06:00 by GiteaMirror · 4 comments
Owner

Originally created by @6543 on GitHub (Oct 7, 2023).

There still exist a lot of string values in the codebase of "master"

we at least should use one single const.
but it's better to respect repo specific settings if posible

we should try to determine what the default branch of a repo or at least of the system is

Originally posted by @6543 in https://github.com/go-gitea/gitea/pull/23894#discussion_r1349498540

Originally created by @6543 on GitHub (Oct 7, 2023). There still exist a lot of string values in the codebase of `"master"` we at least should use one single const. but it's better to respect repo specific settings if posible we should try to determine what the default branch of a repo or at least of the system is _Originally posted by @6543 in https://github.com/go-gitea/gitea/pull/23894#discussion_r1349498540_
GiteaMirror added the issue/needs-feedbacktype/refactoring labels 2025-11-02 09:48:20 -06:00
Author
Owner

@silverwind commented on GitHub (Oct 7, 2023):

  1. check per-repo setting
  2. fall back to global default

Indeed we should have no hardcoded master strings in the code anywhere.

@silverwind commented on GitHub (Oct 7, 2023): 1. check per-repo setting 2. fall back to global default Indeed we should have no hardcoded `master` strings in the code anywhere.
Author
Owner

@wxiaoguang commented on GitHub (Oct 7, 2023):

When I did Use "main" as default branch name #19354 , there are only 2 cases left:

  1. The test code
  2. The wiki

Otherwise, I do not see still exist a lot of string values in the codebase of "master"

@wxiaoguang commented on GitHub (Oct 7, 2023): When I did `Use "main" as default branch name` #19354 , there are only 2 cases left: 1. The test code 2. ~~The wiki~~ Otherwise, I do not see `still exist a lot of string values in the codebase of "master"`
Author
Owner

@wxiaoguang commented on GitHub (Nov 25, 2024):

I think it isn't a problem now?

@wxiaoguang commented on GitHub (Nov 25, 2024): I think it isn't a problem now?
Author
Owner

@6543 commented on GitHub (Nov 25, 2024):

yes it was continiously worked on so I guess it is now fixed :)

@6543 commented on GitHub (Nov 25, 2024): yes it was continiously worked on so I guess it is now fixed :)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#11806