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:
bircni committed 2026-10-18 21:30:21 +02:00
1 parent 33f3ff10b6
commit 757b5fa1b9
12 files changed
+150 -8

No files matched your search

+6
View File
@@ -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))