gitea/models/fixtures
Jason Song 82728a7cec
Do not overwrite empty DefaultBranch (#22708)
Fix #21994. 
And fix #19470.

While generating new repo from a template, it does something like
"commit to git repo, re-fetch repo model from DB, and update default
branch if it's empty".


19d5b2f922/modules/repository/generate.go (L241-L253)

Unfortunately, when load repo from DB, the default branch will be set to
`setting.Repository.DefaultBranch` if it's empty:


19d5b2f922/models/repo/repo.go (L228-L233)

I believe it's a very old temporary patch but has been kept for many
years, see:
[2d2d85bb](https://github.com/go-gitea/gitea/commit/2d2d85bb#diff-1851799b06733db4df3ec74385c1e8850ee5aedee70b8b55366910d22725eea8)

I know it's a risk to delete it, may lead to potential behavioral
changes, but we cannot keep the outdated `FIXME` forever. On the other
hand, an empty `DefaultBranch` does make sense: an empty repo doesn't
have one conceptually (actually, Gitea will still set it to
`setting.Repository.DefaultBranch` to make it safer).
2023-02-02 14:48:48 -06:00
..
access_token.yml
access.yml
action.yml
attachment.yml
collaboration.yml
comment.yml
commit_status_index.yml
commit_status.yml
deleted_branch.yml
deploy_key.yml
email_address.yml
external_login_user.yml
follow.yml
gpg_key_import.yml
gpg_key.yml
hook_task.yml
issue_assignees.yml
issue_index.yml
issue_label.yml
issue_user.yml
issue_watch.yml
issue.yml
label.yml
lfs_meta_object.yml Test views of LFS files (#22196) 2022-12-23 07:41:56 +08:00
login_source.yml
milestone.yml
notice.yml
notification.yml
oauth2_application.yml
oauth2_authorization_code.yml
oauth2_grant.yml
org_user.yml
project_board.yml Support org/user level projects (#22235) 2023-01-20 19:42:33 +08:00
project_issue.yml
project.yml Support org/user level projects (#22235) 2023-01-20 19:42:33 +08:00
protected_branch.yml
public_key.yml
pull_request.yml
reaction.yml
release.yml
renamed_branch.yml
repo_archiver.yml
repo_indexer_status.yml
repo_redirect.yml
repo_topic.yml
repo_transfer.yml
repo_unit.yml Test views of LFS files (#22196) 2022-12-23 07:41:56 +08:00
repository.yml Do not overwrite empty DefaultBranch (#22708) 2023-02-02 14:48:48 -06:00
review.yml
star.yml
stopwatch.yml
system_setting.yml
team_repo.yml
team_unit.yml
team_user.yml Don't return duplicated users who can create org repo (#22560) 2023-01-30 18:12:45 +08:00
team.yml Don't return duplicated users who can create org repo (#22560) 2023-01-30 18:12:45 +08:00
topic.yml
tracked_time.yml
two_factor.yml
user_open_id.yml
user_redirect.yml
user.yml Don't return duplicated users who can create org repo (#22560) 2023-01-30 18:12:45 +08:00
watch.yml
webauthn_credential.yml
webhook.yml