gitea/modules
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>
2020-09-25 07:09:23 +03:00
..
analyze Exclude generated files from language statistics (#11653) 2020-05-29 09:20:01 +03:00
auth Fix handling of migration errors (#12928) 2020-09-23 15:25:46 -05:00
avatar Fix Avatar Resize (resize algo NearestNeighbor -> Bilinear) (#12745) 2020-09-06 20:53:33 +01:00
base Use a simple format for the big number on ui (#12822) 2020-09-16 00:07:18 -04:00
cache Use hash of repo path, ref and entrypath as cache key (#12151) 2020-07-06 01:40:34 +03:00
charset Ensure that the detected charset order is set in chardet test (#12574) 2020-08-23 14:15:29 +01:00
context Add configurable Trust Models (#11712) 2020-09-20 00:44:55 +08:00
convert Refactor: move Commit To APIFormat Code & Lot of StopWatch related things (#12729) 2020-09-18 20:09:26 +08:00
cron Mirror System Notice reports are too frequent (#12438) 2020-08-05 21:40:36 +01:00
emoji Fix emoji detection in certain cases (#12320) 2020-07-25 16:40:04 +03:00
eventsource Move EventSource to SharedWorker (#12095) 2020-07-03 10:55:36 +01:00
generate Add gitea-vet (#10948) 2020-04-05 07:20:50 +01:00
git Adopt repositories (#12920) 2020-09-25 07:09:23 +03:00
gitgraph Render the git graph on the server (#12333) 2020-08-06 09:04:08 +01:00
graceful Set TLS minimum version to 1.2 (#12689) 2020-09-02 23:37:49 +01:00
highlight Escape failed highlighted code (#12685) 2020-09-02 16:19:42 -04:00
httplib Add golangci (#6418) 2019-06-12 15:41:28 -04:00
indexer fix: use Base36 for all code indexers (#12830) 2020-09-14 13:40:07 +03:00
lfs LFS support to be stored on minio (#12518) 2020-09-08 23:45:10 +08:00
log Re-attempt to delete temporary upload if the file is locked by another process (#12447) 2020-08-11 21:05:34 +01:00
markup Fix markdown meta parsing (#12817) 2020-09-12 21:48:47 -04:00
metrics Prometheus endpoint (#5256) 2018-11-04 22:20:00 -05:00
migrations Hopefully support GH enterprise (#12863) 2020-09-21 10:36:51 -04:00
notification Fix panic when adding long comment (#12892) 2020-09-18 13:50:06 -04:00
options Rename scripts to build and add revive command as a new build tool command (#10942) 2020-04-03 22:29:12 +03:00
password Check passwords against HaveIBeenPwned (#12716) 2020-09-08 17:06:39 -05:00
pprof Add golangci (#6418) 2019-06-12 15:41:28 -04:00
private Rename models.ProtectedBranchRepoID to models.EnvRepoID and ensure EnvPusherEmail is set (#12646) 2020-08-30 08:24:39 +01:00
process Only write to global gitconfig if necessary (#11876) 2020-06-13 17:47:31 -04:00
public fix go1.15 lint error in modules/public/public.go (#12707) 2020-09-04 16:15:54 +03:00
queue Add queue for code indexer (#10332) 2020-09-07 23:05:08 +08:00
recaptcha fixed reCAPTCHA URL (#9083) 2019-11-22 08:03:45 +00:00
references Add spent time to referenced issue in commit message (#12220) 2020-09-04 11:37:37 -04:00
repofiles Add configurable Trust Models (#11712) 2020-09-20 00:44:55 +08:00
repository Adopt repositories (#12920) 2020-09-25 07:09:23 +03:00
secret Integrate OAuth2 Provider (#5378) 2019-03-08 11:42:50 -05:00
session When reading expired sessions - expire them (#12686) 2020-09-02 17:10:35 -04:00
setting Adopt repositories (#12920) 2020-09-25 07:09:23 +03:00
ssh log.Fatal on failure to listen to SSH port (#10795) 2020-03-23 07:59:38 +00:00
storage LFS support to be stored on minio (#12518) 2020-09-08 23:45:10 +08:00
structs API: NotificationSubject show Issue/Pull State (#12901) 2020-09-20 19:10:53 -04:00
svg Fix filepath basename on Windows for SVG bindata (#12241) 2020-07-13 21:16:40 +01:00
sync Fix missing unlock in uniquequeue (#9790) 2020-01-15 23:58:33 +02:00
task [API] Migration: Change ServiceType String (#12672) 2020-09-10 23:29:19 +01:00
templates Use a simple format for the big number on ui (#12822) 2020-09-16 00:07:18 -04:00
test Macaron 1.5 (#12596) 2020-08-27 22:47:17 -04:00
timeutil Fix timezone on issue deadline (#11697) 2020-06-05 18:51:10 -04:00
upload Fix upload file type check (#7890) 2019-08-17 13:10:17 +03:00
user Add gitea-vet (#10948) 2020-04-05 07:20:50 +01:00
util Re-attempt to delete temporary upload if the file is locked by another process (#12447) 2020-08-11 21:05:34 +01:00
validation [API] Get a single commit via Ref (#10915) 2020-04-07 22:54:46 -04:00
webhook Refactor webhook payload convertion (#12310) 2020-09-04 22:57:13 -04:00