gitea/models
赵智超 dfa7291f8f
[Enhancement] Allow admin to merge pr with protected file changes ()
* [Enhancement] Allow admin to merge pr with protected file changes

As tilte, show protected message in diff page and merge box.

Signed-off-by: a1012112796 <1012112796@qq.com>

* remove unused ver

* Update options/locale/locale_en-US.ini

Co-authored-by: Cirno the Strongest <1447794+CirnoT@users.noreply.github.com>

* Add TrN

* Apply suggestions from code review

* fix lint

* Update options/locale/locale_en-US.ini

Co-authored-by: zeripath <art27@cantab.net>

* Apply suggestions from code review

* move pr proteced files check to TestPatch
* Call TestPatch when protected branches settings changed

* Apply review suggestion @CirnoT

* move to service @lunny

* slightly restructure routers/private/hook.go

Adds a lot of comments and simplifies the logic

Signed-off-by: Andrew Thornton <art27@cantab.net>

* placate lint

Signed-off-by: Andrew Thornton <art27@cantab.net>

* skip duplicate protected files check

* fix check logic

* slight refactor of TestPatch

Signed-off-by: Andrew Thornton <art27@cantab.net>

* When checking for protected files changes in TestPatch use the temporary repository

Signed-off-by: Andrew Thornton <art27@cantab.net>

* fix introduced issue with hook

Signed-off-by: Andrew Thornton <art27@cantab.net>

* Remove the check on PR index being greater than 0 as it unnecessary

Signed-off-by: Andrew Thornton <art27@cantab.net>

Co-authored-by: techknowlogick <matti@mdranta.net>
Co-authored-by: Cirno the Strongest <1447794+CirnoT@users.noreply.github.com>
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
..
fixtures Add team support for review request ()
migrations [Enhancement] Allow admin to merge pr with protected file changes ()
access.go Upgrade xorm to v1.0.0 ()
access_test.go Fix "access" fixtures and tests ()
action.go Make dashboard newsfeed list length a configurable item ()
action_list.go refactor: reduce sql query in retrieveFeeds ()
action_test.go Add gitea-vet ()
admin.go Add default storage configurations ()
admin_test.go Fix tests code to prevent some runtime errors ()
attachment.go Add a storage layer for attachments ()
attachment_test.go Reading pull attachments should depend on read UnitTypePullRequests ()
avatar.go Open transaction when adding Avatar email-hash pairs to the DB ()
branches.go [Enhancement] Allow admin to merge pr with protected file changes ()
branches_test.go Add deleted_branch table fixture ()
commit_status.go API add/generalize pagination ()
commit_status_test.go Fix wrong hint when status checking is running on pull request view ()
consistency.go Add migration to set IsArchived false if it is null ()
context.go Upgrade xorm to v1.0.2 ()
convert.go Whilst changing the character set to utf8mb4 we should set ROW_FORMAT=dynamic too ()
error.go Add team support for review request ()
error_oauth2.go gofmt ()
external_login_user.go Migrate reviews when migrating repository from github ()
fixture_generation.go Move fixture generation to contrib and add test ()
fixture_test.go Move fixture generation to contrib and add test ()
gpg_key.go Add configurable Trust Models ()
gpg_key_test.go Allow addition of gpg keyring with multiple keys ()
helper.go Add reactions to issues/PR and comments ()
helper_directory.go Re-attempt to delete temporary upload if the file is locked by another process ()
helper_environment.go Set setting.AppURL as GITEA_ROOT_URL environment variable during pushes ()
issue.go (Re)Load issue labels when changing them ()
issue_assignees.go Remove Unused Functions ()
issue_assignees_test.go Fix API Bug (fail on empty assignees) ()
issue_comment.go Add team support for review request ()
issue_comment_list.go Fixed repo link in generated comment for cross repository dependency ()
issue_comment_test.go Pull request review/approval and comment on code ()
issue_dependency.go Display ui time with customize time location ()
issue_dependency_test.go Refactor comment ()
issue_label.go Save TimeStamps for Star, Label, Follow, Watch and Collaboration to Database ()
issue_label_test.go Save TimeStamps for Star, Label, Follow, Watch and Collaboration to Database ()
issue_list.go [BugFix] ReviewCount: GetApprovalCounts func sorted wrong ()
issue_list_test.go Add Organization Wide Labels ()
issue_lock.go remove unused method and rename createcommentWithNoAction ()
issue_milestone.go Add Created & Updated to Milestone ()
issue_milestone_test.go Add name filter to API for GetMilestoneList ()
issue_reaction.go API add/generalize pagination ()
issue_reaction_test.go Migrate reactions when migrating repository from github ()
issue_stopwatch.go Refactor: move Commit To APIFormat Code & Lot of StopWatch related things ()
issue_stopwatch_test.go Add gitea-vet ()
issue_test.go issue search on my related repositories ()
issue_tracked_time.go Fix tracked time issues ()
issue_tracked_time_test.go [API] Extend times API ()
issue_user.go Mail assignee when issue/pull request is assigned ()
issue_user_test.go Add "Update Branch" button to Pull Requests ()
issue_watch.go Add issue subscription check to API ()
issue_watch_test.go API add/generalize pagination ()
issue_xref.go remove unused method and rename createcommentWithNoAction ()
issue_xref_test.go Refactor comment ()
lfs.go LFS support to be stored on minio ()
lfs_lock.go Make repository management section handle lfs locks ()
list_options.go Add cron running API ()
log.go Upgrade xorm to v1.0.0 ()
login_source.go Use ID or Where to instead directly use Get when load object from database ()
main_test.go Add gitea-vet ()
migrate.go [BugFix] remove nil inserts in models ()
models.go Add postgres schema to the search_path on database connection ()
models_test.go gitea dump: include version & Check InstallLock ()
notification.go API: NotificationSubject show Issue/Pull State ()
notification_test.go add request review from specific reviewers feature in pull request ()
oauth2.go Changed image of openid-connect logo for better look on arc-green theme ()
oauth2_application.go Use google/uuid to instead satori/go.uuid ()
oauth2_application_test.go OAuth2 Grant UI ()
org.go Fix bug preventing transfer to private organization ()
org_team.go Automatically remove Watches, Assignments, etc if user loses access due to being removed as collaborator or from a team ()
org_team_test.go API add/generalize pagination ()
org_test.go Ensure DeleteUser is not allowed to Delete Orgs and visa versa ()
project.go Kanban board ()
project_board.go Kanban board ()
project_issue.go Kanban board ()
project_test.go Kanban board ()
pull.go [Enhancement] Allow admin to merge pr with protected file changes ()
pull_list.go API add/generalize pagination ()
pull_sign.go Add configurable Trust Models ()
pull_test.go Display pull request head branch even the branch deleted or repository deleted ()
release.go Add email notify for new release ()
repo.go Add team support for review request ()
repo_activity.go Add top author stats to activity page ()
repo_branch.go Move newbranch to standalone package ()
repo_collaboration.go Save TimeStamps for Star, Label, Follow, Watch and Collaboration to Database ()
repo_collaboration_test.go API add/generalize pagination ()
repo_generate.go API add/generalize pagination ()
repo_generate_test.go Variable expansion in repository templates ()
repo_indexer.go Index code and stats only for non-empty repositories ()
repo_issue.go Add EnableTimetracking option to app settings ()
repo_language_stats.go Increase size of the language column in language_stat ()
repo_list.go Adopt repositories ()
repo_list_test.go API add/generalize pagination ()
repo_mirror.go Move some repository methods from models to modules/repository ()
repo_permission.go Fix deadlock when deleting team user ()
repo_permission_test.go fix bug when update owner team then visit team's repo return 404 ()
repo_redirect.go Move repoWorkPool outside rename/transfer repository ()
repo_redirect_test.go Move repoWorkPool outside rename/transfer repository ()
repo_sign.go Add configurable Trust Models ()
repo_test.go Add team support for review request ()
repo_unit.go Kanban board ()
repo_watch.go Save TimeStamps for Star, Label, Follow, Watch and Collaboration to Database ()
repo_watch_test.go API add/generalize pagination ()
review.go Add team support for review request ()
review_test.go Add team support for review request ()
ssh_key.go Add ssh certificate support ()
ssh_key_test.go Disable DSA ssh keys by default ()
star.go Save TimeStamps for Star, Label, Follow, Watch and Collaboration to Database ()
star_test.go API add/generalize pagination ()
task.go [API] Migration: Change ServiceType String ()
test_fixtures.go upgrade to use testfixtures v3 ()
token.go [API] Delete Token accept names too ()
token_test.go [API] Delete Token accept names too ()
topic.go Add Primary Key to Topic and RepoTopic ()
topic_test.go API add/generalize pagination ()
twofactor.go Attachments: Add extension support, allow all types for releases ()
u2f.go Display ui time with customize time location ()
u2f_test.go Add gitea-vet ()
unit.go Kanban board ()
unit_tests.go Provide self-registering storage system ()
update.go Remove Unused Functions ()
upload.go Re-attempt to delete temporary upload if the file is locked by another process ()
user.go Add ssh certificate support ()
user_follow.go Save TimeStamps for Star, Label, Follow, Watch and Collaboration to Database ()
user_follow_test.go Add gitea-vet ()
user_heatmap.go Add hide activity option ()
user_heatmap_test.go Restricted users ()
user_mail.go Use ID or Where to instead directly use Get when load object from database ()
user_mail_test.go Admin page for managing user e-mail activation ()
user_openid.go Use ID or Where to instead directly use Get when load object from database ()
user_openid_test.go Add golangci ()
user_test.go Fix "only mail on mention" bug ()
userlist.go API add/generalize pagination ()
userlist_test.go Team permission to create repository in organization ()
webhook.go Use google/uuid to instead satori/go.uuid ()
webhook_test.go Granular webhook events ()
wiki.go Add owner_name column for table repository for maintaince reason ()
wiki_test.go Move wiki related funtions from models to services/wiki ()