Commit Graph
7 Commits
Author SHA1 Message Date
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 <[email protected]>

* Update swagger

Signed-off-by: Andrew Thornton <[email protected]>

* Fix tests and migrate overwrite

Signed-off-by: Andrew Thornton <[email protected]>

* 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 <[email protected]>

* Use setting.Repository.DefaultBranch for the default branch

Signed-off-by: Andrew Thornton <[email protected]>

* Always set setting.Repository.DefaultBranch

Signed-off-by: Andrew Thornton <[email protected]>

* update swagger

Signed-off-by: Andrew Thornton <[email protected]>

* update templates

Signed-off-by: Andrew Thornton <[email protected]>

* ensure repo closed

Signed-off-by: Andrew Thornton <[email protected]>

* Rewrite of adoption as per @6543 and @lunny

Signed-off-by: Andrew Thornton <[email protected]>

* Apply suggestions from code review

* update swagger

Signed-off-by: Andrew Thornton <[email protected]>

* missing not

Signed-off-by: Andrew Thornton <[email protected]>

* add modals and flash reporting

Signed-off-by: Andrew Thornton <[email protected]>

* Make the unadopted page searchable

Signed-off-by: Andrew Thornton <[email protected]>

* Add API

Signed-off-by: Andrew Thornton <[email protected]>

* Fix swagger

Signed-off-by: Andrew Thornton <[email protected]>

* fix swagger

Signed-off-by: Andrew Thornton <[email protected]>

* Handle empty and non-master branched repositories

Signed-off-by: Andrew Thornton <[email protected]>

* placate lint

Signed-off-by: Andrew Thornton <[email protected]>

* remove commented out code

Signed-off-by: Andrew Thornton <[email protected]>

Co-authored-by: techknowlogick <[email protected]>
2020-09-25 07:09:23 +03:00
silverwind eb4db0445b Reindent Less to 2-space (#12602)
Reindent and unify codebase to 2-space indentation.
2020-08-25 22:48:53 +03:00
George Merlocco 0d03fbf2ca Ensure tabs wrap correctly on user profile page (#12144)
Co-authored-by: zeripath <[email protected]>
2020-07-05 12:09:52 -04:00
silverwind 4e912d2ed8 Disallow leading zeroes in Less (#10407) 2020-02-23 13:48:27 -03:00
John Olheiser f4370639be Fix profile page CSS (#10406)
* Fix profile page

Signed-off-by: jolheiser <[email protected]>

* Remove redundant CSS

Signed-off-by: jolheiser <[email protected]>

* Fix .username and change em to rem

Signed-off-by: jolheiser <[email protected]>

Co-authored-by: Lauris BH <[email protected]>
2020-02-22 16:06:07 +02:00
John Olheiser 86fdba177a Add Octicon SVG spritemap (#10107)
* Add octicon SVG sprite

Signed-off-by: jolheiser <[email protected]>

* Static prefix

Signed-off-by: jolheiser <[email protected]>

* SVG for all repo icons

Signed-off-by: jolheiser <[email protected]>

* make vendor

Signed-off-by: jolheiser <[email protected]>

* Swap out octicons

Signed-off-by: jolheiser <[email protected]>

* Move octicons to top of less imports

Signed-off-by: jolheiser <[email protected]>

* Fix JS

Signed-off-by: jolheiser <[email protected]>

* Definitely not a search/replace

Signed-off-by: jolheiser <[email protected]>

* Missed regex

Signed-off-by: jolheiser <[email protected]>

* Move to more generic calls and webpack

Signed-off-by: jolheiser <[email protected]>

* make svg -> make webpack

Signed-off-by: jolheiser <[email protected]>

* Remove svg-sprite

Signed-off-by: jolheiser <[email protected]>

* Update tests

Signed-off-by: jolheiser <[email protected]>

* Missed a test

Signed-off-by: jolheiser <[email protected]>

* Remove svg from makefile

Signed-off-by: jolheiser <[email protected]>

* Suggestions

Signed-off-by: jolheiser <[email protected]>

* Attempt to fix test

Signed-off-by: jolheiser <[email protected]>

* Update tests

Signed-off-by: jolheiser <[email protected]>

* Revert timetracking test

Signed-off-by: jolheiser <[email protected]>

* Swap .octicon for .svg in less

Signed-off-by: jolheiser <[email protected]>

* Add aria-hidden

Signed-off-by: jolheiser <[email protected]>

* Replace mega-octicon

Signed-off-by: jolheiser <[email protected]>

* Fix webpack globbing on Windows

Signed-off-by: jolheiser <[email protected]>

* Revert

Co-Authored-By: silverwind <[email protected]>

* Fix octions from upstream

Signed-off-by: jolheiser <[email protected]>

* Fix Vue and missed JS function

Signed-off-by: jolheiser <[email protected]>

* Add JS helper and PWA

Signed-off-by: jolheiser <[email protected]>

* Preload SVG

Signed-off-by: jolheiser <[email protected]>

Co-authored-by: silverwind <[email protected]>
Co-authored-by: techknowlogick <[email protected]>
2020-02-11 12:02:41 -05:00
Lunny Xiao e4e6d48e30 Move less from public/ to web_src/ so that it will not be packe… (#8908) 2019-11-12 10:22:16 +01:00