add debug mode and update readme (#805)

Fix #456
Fix #207

Reviewed-on: https://gitea.com/gitea/tea/pulls/805
This commit is contained in:
Lunny Xiao
2025-09-10 19:10:02 +00:00
parent d531c6fdb0
commit 6c958eec99
5 changed files with 118 additions and 54 deletions

View File

@ -10,6 +10,7 @@ import (
"code.gitea.io/tea/cmd/flags"
"code.gitea.io/tea/modules/config"
"code.gitea.io/tea/modules/context"
"code.gitea.io/tea/modules/debug"
"code.gitea.io/tea/modules/git"
"code.gitea.io/tea/modules/interact"
"code.gitea.io/tea/modules/task"
@ -68,12 +69,15 @@ func runRepoClone(ctx stdctx.Context, cmd *cli.Command) error {
return err
}
debug.Printf("Cloning repository %s into %s", url.String(), dir)
owner, repo = utils.GetOwnerAndRepo(url.Path, login.User)
if url.Host != "" {
login = config.GetLoginByHost(url.Host)
if login == nil {
return fmt.Errorf("No login configured matching host '%s', run `tea login add` first", url.Host)
}
debug.Printf("Matched login '%s' for host '%s'", login.Name, url.Host)
}
_, err = task.RepoClone(