Skip to content

Commit ceefd98

Browse files
committed
Use git service string but not int
1 parent 80b5c9a commit ceefd98

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

cmd/dump_repo.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ import (
88
"context"
99
"strings"
1010

11+
"code.gitea.io/gitea/modules/convert"
1112
"code.gitea.io/gitea/modules/log"
1213
"code.gitea.io/gitea/modules/migrations"
1314
"code.gitea.io/gitea/modules/migrations/base"
1415
"code.gitea.io/gitea/modules/setting"
15-
"code.gitea.io/gitea/modules/structs"
1616

1717
"github.com/urfave/cli"
1818
)
@@ -24,10 +24,10 @@ var CmdDumpRepository = cli.Command{
2424
Description: "This is a command for dumping the repository data.",
2525
Action: runDumpRepository,
2626
Flags: []cli.Flag{
27-
cli.IntFlag{
27+
cli.StringFlag{
2828
Name: "git_service",
29-
Value: 1,
30-
Usage: "Git service, 1 plain git, 2 github, 3 gitea, 4 gitlab",
29+
Value: "",
30+
Usage: "Git service, git, github, gitea, gitlab",
3131
},
3232
cli.StringFlag{
3333
Name: "repo_dir, r",
@@ -85,7 +85,7 @@ func runDumpRepository(ctx *cli.Context) error {
8585
setting.InitDBConfig()
8686

8787
var opts = base.MigrateOptions{
88-
GitServiceType: structs.GitServiceType(ctx.Int("git_service")),
88+
GitServiceType: convert.ToGitServiceType(ctx.String("git_service")),
8989
CloneAddr: ctx.String("clone_addr"),
9090
AuthUsername: ctx.String("auth_username"),
9191
AuthPassword: ctx.String("auth_password"),

docs/content/doc/usage/command-line.en-us.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ Manage running server operations:
447447
Dump-repo dumps repository data from git/github/gitea/gitlab:
448448

449449
- Options:
450-
- `--git_service service` : Git service, 1 plain git, 2 github, 3 gitea, 4 gitlab
450+
- `--git_service service` : Git service, it could be `git`, `github`, `gitea`, `gitlab`
451451
- `--repo_dir dir`, `-r dir`: Repository dir path to store the data
452452
- `--clone_addr addr`: The URL will be clone, currently could be a git/github/gitea/gitlab http/https URL. i.e. https://github.com/lunny/tango.git
453453
- `--auth_username lunny`: The username to visit the clone_addr

0 commit comments

Comments
 (0)