You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
zeripath 7a7f56044a
Adopt repositories (#12920)
* Don't automatically delete repository files if they are present

Prior to this PR Gitea would delete any repository files if they are
present during creation or migration. This can in certain circumstances
lead to data-loss and is slightly unpleasant.

This PR provides a mechanism for Gitea to adopt repositories on creation
and otherwise requires an explicit flag for deletion.

PushCreate is slightly different - the create will cause adoption if
that is allowed otherwise it will delete the data if that is allowed.

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

* Update swagger

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

* Fix tests and migrate overwrite

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

* as per @lunny

Only offer to adopt or overwrite if the user can do that.

Allow the site administrator to adopt or overwrite in all
circumstances

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

* Use setting.Repository.DefaultBranch for the default branch

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

* Always set setting.Repository.DefaultBranch

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

* update swagger

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

* update templates

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

* ensure repo closed

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

* Rewrite of adoption as per @6543 and @lunny

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

* Apply suggestions from code review

* update swagger

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

* missing not

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

* add modals and flash reporting

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

* Make the unadopted page searchable

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

* Add API

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

* Fix swagger

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

* fix swagger

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

* Handle empty and non-master branched repositories

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

* placate lint

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

* remove commented out code

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

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
4 years ago
..
activity.go Add top author stats to activity page (#9615) 5 years ago
attachment.go Add a storage layer for attachments (#11387) 4 years ago
blame.go Ensure BlameReaders close at end of request (#12102) 4 years ago
branch.go Move all push update operations to a queue (#10133) 4 years ago
commit.go Render the git graph on the server (#12333) 4 years ago
compare.go Issue templates directory (#11450) 4 years ago
download.go Add a storage layer for attachments (#11387) 4 years ago
editor.go Do not disable commit changes button on repost (#12644) 4 years ago
editor_test.go Add Close() method to gogitRepository (#8901) 5 years ago
http.go Set setting.AppURL as GITEA_ROOT_URL environment variable during pushes (#12752) 4 years ago
issue.go Add configurable Trust Models (#11712) 4 years ago
issue_dependency.go Fix wrong permissions check when issues/prs shared operations (#9885) 5 years ago
issue_label.go Move jquery-minicolors to npm/webpack (#12305) 4 years ago
issue_label_test.go fix go vet error (#3740) 6 years ago
issue_lock.go Implement "conversation lock" for issue comments (#5073) 5 years ago
issue_stopwatch.go Automatically clear stopwatch on merging a PR (#4327) 5 years ago
issue_timetrack.go [API] Extend times API (#9200) 5 years ago
issue_watch.go Fix PR/issue redirects when having external tracker (#9339) 5 years ago
lfs.go LFS support to be stored on minio (#12518) 4 years ago
main_test.go Unit tests for wiki routers (#3022) 7 years ago
middlewares.go Add gitea-vet (#10948) 4 years ago
migrate.go Adopt repositories (#12920) 4 years ago
milestone.go Issue templates directory (#11450) 4 years ago
projects.go Hide 'New Project board' button for users that are not signed in (#12547) 4 years ago
pull.go Move all push update operations to a queue (#10133) 4 years ago
pull_review.go Add a way to mark Conversation (code comment) resolved (#11037) 4 years ago
release.go Support slashes in release tags (#12864) 4 years ago
release_test.go Add Close() method to gogitRepository (#8901) 5 years ago
repo.go Adopt repositories (#12920) 4 years ago
search.go Add detected file language to code search (#10256) 4 years ago
setting.go Adopt repositories (#12920) 4 years ago
setting_protected_branch.go Prevent merge of outdated PRs on protected branches (#11012) 4 years ago
settings_test.go Re-attempt to delete temporary upload if the file is locked by another process (#12447) 4 years ago
topic.go Add API endpoint for accessing repo topics (#7963) 5 years ago
view.go Add a migrate service type switch page (#12697) 4 years ago
webhook.go Don't use legacy method to send Matrix Webhook (#12348) 4 years ago
wiki.go Allow different HardBreaks settings for documents and comments (#11515) 4 years ago
wiki_test.go Fix wiki raw view on sub path (#10002) 4 years ago