Commit graph

13 commits

Author SHA1 Message Date
wxiaoguang
7c1f18a2bb
Fix cli command restore-repo: "units" should be splitted to string slice, to match the old behavior and match the dump-repo's behavior () 2022-07-01 15:47:44 +08:00
zeripath
1e9ad8eb21
Write Commit-Graphs in RepositoryDumper ()
When migrating git repositories we should ensure that the commit-graph is written.

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: delvh <dev.lh@web.de>
2022-06-17 21:19:21 +01:00
wxiaoguang
9f87b60b46
Fix cli command restore-repo: "units" should be parsed as StringSlice ()
* Fix cli command restore-repo: "units" should be parsed as StringSlice because after   it's read by c.StringSlice("units").  Before, the "units" were processed by strings.Split
* Add checking for invalid unit names

Co-authored-by: 6543 <6543@obermui.de>
2022-06-15 20:28:03 +08:00
wxiaoguang
124b072f0b
Remove git.Command.Run and git.Command.RunInDir* ()
Follows , , Close , now there are only three `Run..(&RunOpts{})` functions.
 * before: `stdout, err := RunInDir(path)`
 * now: `stdout, _, err := RunStdString(&git.RunOpts{Dir:path})`
2022-04-01 10:55:30 +08:00
6543
3e88af898a
Make git.OpenRepository accept Context ()
* OpenRepositoryCtx -> OpenRepository
* OpenRepository -> openRepositoryWithDefaultContext, only for internal usage
2022-03-30 03:13:41 +08:00
zeripath
2d21d2af9e
Make migrations SKIP_TLS_VERIFY apply to git too ()
Make SKIP_TLS_VERIFY apply to git data migrations too through adding the `-c http.sslVerify=false` option to the git clone command.

Fix 

Signed-off-by: Andrew Thornton <art27@cantab.net>
2022-03-19 14:16:38 +00:00
6543
3043eb36bf
Delete old git.NewCommand() and use it as git.NewCommandContext() () 2022-02-06 20:01:47 +01:00
3bb028cc46
Validate migration files ()
JSON Schema validation for data used by Gitea during migrations

Discussion at https://forum.forgefriends.org/t/common-json-schema-for-repository-information/563

Co-authored-by: Loïc Dachary <loic@dachary.org>
2022-01-26 10:45:51 +01:00
6543
54e9ee37a7
format with gofumpt ()
* gofumpt -w -l .

* gofumpt -w -l -extra .

* Add linter

* manual fix

* change make fmt
2022-01-20 18:46:10 +01:00
zeripath
5cb0c9aa0d
Propagate context and ensure git commands run in request context ()
This PR continues the work in  by progressively ensuring that git
commands run within the request context.

This now means that the if there is a git repo already open in the context it will be used instead of reopening it.

Signed-off-by: Andrew Thornton <art27@cantab.net>
2022-01-19 23:26:57 +00:00
Gusted
ff2fd08228
Simplify parameter types ()
Remove repeated type declarations in function definitions.
2021-12-20 04:41:31 +00:00
Lunny Xiao
a666829a37
Move user related model into models/user ()
* Move user related model into models/user

* Fix lint for windows

* Fix windows lint

* Fix windows lint

* Move some tests in models

* Merge
2021-11-24 17:49:20 +08:00
Lunny Xiao
7e1ae38097
Move migrations into services and base into modules/migration ()
* Move migrtions into services and base into modules/migration

* Fix imports

* Fix lint
2021-11-16 23:25:33 +08:00
Renamed from modules/migrations/dump.go (Browse further)