mirror of
https://gitea.com/gitea/tea.git
synced 2026-10-26 19:11:25 +01:00
fix(repo): README lookup like Gitea, clearer branch/org errors, clone-after-create report, mirror interval 0 and search sort (follow gh)
Signed-off-by: bircni <bircni@icloud.com>
This commit is contained in:
16 files changed
+211
-37
No files matched your search
@@ -133,7 +133,10 @@ $ tea repo migrate https://github.com/acme/tool --service github --issues --pull
|
||||
return err
|
||||
}
|
||||
detail := ""
|
||||
interval, _ := time.ParseDuration(opts.MirrorInterval)
|
||||
switch {
|
||||
case item.Mirror && opts.MirrorInterval != "" && interval == 0:
|
||||
detail = " (pull mirror, synced manually)"
|
||||
case item.Mirror && opts.MirrorInterval != "":
|
||||
detail = " (pull mirror, every " + opts.MirrorInterval + ")"
|
||||
case item.Mirror:
|
||||
@@ -161,7 +164,7 @@ $ tea repo migrate https://github.com/acme/tool --service github --issues --pull
|
||||
flags.BoolVar(&opts.PullRequests, "pull-requests", false, "Copy pull requests")
|
||||
flags.BoolVar(&opts.Releases, "releases", false, "Copy releases")
|
||||
flags.BoolVar(&opts.Milestones, "milestones", false, "Copy milestones")
|
||||
flags.StringVar(&opts.MirrorInterval, "mirror-interval", "", "Mirror interval, for example 8h")
|
||||
flags.StringVar(&opts.MirrorInterval, "mirror-interval", "", "Mirror interval, for example 8h (0 turns off periodic sync)")
|
||||
flags.BoolVar(&opts.LFS, "lfs", false, "Copy LFS objects")
|
||||
flags.StringVar(&opts.LFSEndpoint, "lfs-endpoint", "", "Source LFS endpoint")
|
||||
flags.StringVar(&opts.AuthUser, "auth-user", "", "Source authentication username")
|
||||
@@ -201,8 +204,8 @@ func validateMigrationFlags(cmd *cobra.Command, opts services.RepositoryMigratio
|
||||
}
|
||||
if opts.MirrorInterval != "" {
|
||||
interval, err := time.ParseDuration(opts.MirrorInterval)
|
||||
if err != nil || interval <= 0 || !opts.Mirror {
|
||||
return clierr.Wrap(clierr.Usage, errors.New("--mirror-interval requires --mirror and a positive duration"))
|
||||
if err != nil || interval < 0 || !opts.Mirror {
|
||||
return clierr.Wrap(clierr.Usage, errors.New("--mirror-interval requires --mirror and a duration of 0 or more"))
|
||||
}
|
||||
}
|
||||
return nil
|
||||
|
||||
Reference in new issue
Block a user