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