mirror of
https://gitea.com/gitea/tea.git
synced 2026-10-26 19:11:25 +01:00
fix: send a team's permission before its units (Gitea 28), hidden private-org team reviews, long non-ASCII repo descriptions, -R NAME vs directory guard, flake fallback
Signed-off-by: bircni <bircni@icloud.com>
This commit is contained in:
12 files changed
+150
-8
No files matched your search
@@ -9,6 +9,8 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"maps"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"slices"
|
||||
"strconv"
|
||||
"strings"
|
||||
@@ -102,6 +104,10 @@ func (a *application) resolveRequest(ctx context.Context, req targetRequest) (ta
|
||||
}
|
||||
// A bare repository NAME belongs to the account tea acts as, which is known only now.
|
||||
if t.Repo != "" && !strings.Contains(t.Repo, "/") {
|
||||
// A name that is also a directory here may be meant as that checkout, as in tea -R ./project.
|
||||
if info, statErr := os.Stat(filepath.Join(cmp.Or(a.options.cwd, "."), t.Repo)); statErr == nil && info.IsDir() && t.RepoSource == "--repo" {
|
||||
return t, clierr.Wrap(clierr.Usage, fmt.Errorf("%q is both a repository name and a directory here; use OWNER/%s for the repository, or --cwd %s for that checkout", t.Repo, t.Repo, t.Repo))
|
||||
}
|
||||
owner := cmp.Or(a.options.sudo, t.User)
|
||||
if owner == "" {
|
||||
return t, clierr.Wrap(clierr.Usage, fmt.Errorf("cannot tell who owns repository %q; use OWNER/%s", t.Repo, t.Repo))
|
||||
|
||||
Reference in new issue
Block a user