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
..
features Reindent Less to 2-space (#12602) 4 years ago
markdown Reindent Less to 2-space (#12602) 4 years ago
standalone Extract Swagger CSS to its own file (#12616) 4 years ago
themes Fix background of signed-commits on arc-green (#12837) 4 years ago
_admin.less Adopt repositories (#12920) 4 years ago
_base.less Fix line selection on blame view (#12857) 4 years ago
_chroma.less Reindent Less to 2-space (#12602) 4 years ago
_dashboard.less Reindent Less to 2-space (#12602) 4 years ago
_editor.less Reindent Less to 2-space (#12602) 4 years ago
_explore.less Reindent Less to 2-space (#12602) 4 years ago
_form.less Git migration UX (#12619) 4 years ago
_home.less Reindent Less to 2-space (#12602) 4 years ago
_install.less Reindent Less to 2-space (#12602) 4 years ago
_markdown.less Reindent Less to 2-space (#12602) 4 years ago
_organization.less Reindent Less to 2-space (#12602) 4 years ago
_repository.less Add a migrate service type switch page (#12697) 4 years ago
_review.less Reindent Less to 2-space (#12602) 4 years ago
_svg.less Reindent Less to 2-space (#12602) 4 years ago
_tribute.less Reindent Less to 2-space (#12602) 4 years ago
_user.less Adopt repositories (#12920) 4 years ago
helpers.less File header tweaks, add CSS helpers (#12635) 4 years ago
index.less File header tweaks, add CSS helpers (#12635) 4 years ago