From d0b7ea09e8656307db5b6d9b1706a52310af0f3c Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Mon, 20 Apr 2026 19:34:25 +0000 Subject: [PATCH 1/2] fix(deps): update module charm.land/lipgloss/v2 to v2.0.3 (#959) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR contains the following updates: | Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) | |---|---|---|---| | [charm.land/lipgloss/v2](https://github.com/charmbracelet/lipgloss) | `v2.0.2` → `v2.0.3` | ![age](https://developer.mend.io/api/mc/badges/age/go/charm.land%2flipgloss%2fv2/v2.0.3?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/go/charm.land%2flipgloss%2fv2/v2.0.2/v2.0.3?slim=true) | --- ### Release Notes
charmbracelet/lipgloss (charm.land/lipgloss/v2) ### [`v2.0.3`](https://github.com/charmbracelet/lipgloss/releases/tag/v2.0.3) [Compare Source](https://github.com/charmbracelet/lipgloss/compare/v2.0.2...v2.0.3) #### Changelog ##### Fixed - [`472d718`](https://github.com/charmbracelet/lipgloss/commit/472d718e2314596549bee2c0c8ccf8beea5f25ae): fix: Avoid background color query hang ([#​636](https://github.com/charmbracelet/lipgloss/issues/636)) ([@​jedevc](https://github.com/jedevc)) ##### Docs - [`9e39a0a`](https://github.com/charmbracelet/lipgloss/commit/9e39a0ad4f4fc779d620f17783cee3494da6ae29): docs: fix README typo ([#​629](https://github.com/charmbracelet/lipgloss/issues/629)) ([@​Rohan5commit](https://github.com/Rohan5commit)) - [`cd93a9f`](https://github.com/charmbracelet/lipgloss/commit/cd93a9f5d2e3cb151da83150db29751d92585d23): docs: fix tree comment typo ([#​634](https://github.com/charmbracelet/lipgloss/issues/634)) ([@​Rohan5commit](https://github.com/Rohan5commit)) *** The Charm logo Thoughts? Questions? We love hearing from you. Feel free to reach out on [X](https://x.com/charmcli), [Discord](https://charm.land/discord), [Slack](https://charm.land/slack), [The Fediverse](https://mastodon.social/@​charmcli), [Bluesky](https://bsky.app/profile/charm.land).
--- ### Configuration 📅 **Schedule**: (UTC) - Branch creation - At any time (no schedule defined) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). --------- Co-authored-by: Lunny Xiao Reviewed-on: https://gitea.com/gitea/tea/pulls/959 Reviewed-by: Lunny Xiao Co-authored-by: Renovate Bot Co-committed-by: Renovate Bot --- go.mod | 4 ++-- go.sum | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index 671fc65..5016a4e 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.26 require ( charm.land/glamour/v2 v2.0.0 charm.land/huh/v2 v2.0.3 - charm.land/lipgloss/v2 v2.0.2 + charm.land/lipgloss/v2 v2.0.3 code.gitea.io/gitea-vet v0.2.3 code.gitea.io/sdk/gitea v0.24.1 gitea.com/noerw/unidiff-comments v0.0.0-20220822113322-50f4daa0e35c @@ -42,7 +42,7 @@ require ( github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/charmbracelet/colorprofile v0.4.3 // indirect github.com/charmbracelet/ultraviolet v0.0.0-20260330092749-0f94982c930b // indirect - github.com/charmbracelet/x/ansi v0.11.6 // indirect + github.com/charmbracelet/x/ansi v0.11.7 // indirect github.com/charmbracelet/x/exp/ordered v0.1.0 // indirect github.com/charmbracelet/x/exp/slice v0.0.0-20260406091427-a791e22d5143 // indirect github.com/charmbracelet/x/exp/strings v0.1.0 // indirect diff --git a/go.sum b/go.sum index c41e02f..c2a9676 100644 --- a/go.sum +++ b/go.sum @@ -8,6 +8,8 @@ charm.land/huh/v2 v2.0.3 h1:2cJsMqEPwSywGHvdlKsJyQKPtSJLVnFKyFbsYZTlLkU= charm.land/huh/v2 v2.0.3/go.mod h1:93eEveeeqn47MwiC3tf+2atZ2l7Is88rAtmZNZ8x9Wc= charm.land/lipgloss/v2 v2.0.2 h1:xFolbF8JdpNkM2cEPTfXEcW1p6NRzOWTSamRfYEw8cs= charm.land/lipgloss/v2 v2.0.2/go.mod h1:KjPle2Qd3YmvP1KL5OMHiHysGcNwq6u83MUjYkFvEkM= +charm.land/lipgloss/v2 v2.0.3 h1:yM2zJ4Cf5Y51b7RHIwioil4ApI/aypFXXVHSwlM6RzU= +charm.land/lipgloss/v2 v2.0.3/go.mod h1:7myLU9iG/3xluAWzpY/fSxYYHCgoKTie7laxk6ATwXA= code.gitea.io/gitea-vet v0.2.3 h1:gdFmm6WOTM65rE8FUBTRzeQZYzXePKSSB1+r574hWwI= code.gitea.io/gitea-vet v0.2.3/go.mod h1:zcNbT/aJEmivCAhfmkHOlT645KNOf9W2KnkLgFjGGfE= code.gitea.io/sdk/gitea v0.24.1 h1:hpaqcdGcBmfMpV7JSbBJVwE99qo+WqGreJYKrDKEyW8= @@ -57,6 +59,8 @@ github.com/charmbracelet/ultraviolet v0.0.0-20260330092749-0f94982c930b h1:ASDO9 github.com/charmbracelet/ultraviolet v0.0.0-20260330092749-0f94982c930b/go.mod h1:Vo8TffMf0q7Uho/n8e6XpBZvOWtd3g39yX+9P5rRutA= github.com/charmbracelet/x/ansi v0.11.6 h1:GhV21SiDz/45W9AnV2R61xZMRri5NlLnl6CVF7ihZW8= github.com/charmbracelet/x/ansi v0.11.6/go.mod h1:2JNYLgQUsyqaiLovhU2Rv/pb8r6ydXKS3NIttu3VGZQ= +github.com/charmbracelet/x/ansi v0.11.7 h1:kzv1kJvjg2S3r9KHo8hDdHFQLEqn4RBCb39dAYC84jI= +github.com/charmbracelet/x/ansi v0.11.7/go.mod h1:9qGpnAVYz+8ACONkZBUWPtL7lulP9No6p1epAihUZwQ= github.com/charmbracelet/x/conpty v0.1.1 h1:s1bUxjoi7EpqiXysVtC+a8RrvPPNcNvAjfi4jxsAuEs= github.com/charmbracelet/x/conpty v0.1.1/go.mod h1:OmtR77VODEFbiTzGE9G1XiRJAga6011PIm4u5fTNZpk= github.com/charmbracelet/x/errors v0.0.0-20240508181413-e8d8b6e2de86 h1:JSt3B+U9iqk37QUU2Rvb6DSBYRLtWqFqfxf8l5hOZUA= From 783ac7684a38a7b5be63e2587f245cf63e7f372a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C4=9Bj=20Cepl?= Date: Mon, 20 Apr 2026 19:39:42 +0000 Subject: [PATCH 2/2] fix(context): skip local repo detection for repo slugs (#960) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Treat explicit --repo slugs as remote targets so commands do not probe the current worktree. This avoids SHA256 repository failures when local git autodetection is unnecessary. --------- Co-authored-by: Lunny Xiao Reviewed-on: https://gitea.com/gitea/tea/pulls/960 Reviewed-by: Lunny Xiao Co-authored-by: Matěj Cepl Co-committed-by: Matěj Cepl --- modules/context/context.go | 29 ++++++++++--------- modules/context/context_test.go | 49 +++++++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+), 15 deletions(-) diff --git a/modules/context/context.go b/modules/context/context.go index 0fe55b3..7255c68 100644 --- a/modules/context/context.go +++ b/modules/context/context.go @@ -83,6 +83,8 @@ func InitCommand(cmd *cli.Command) (*TeaContext, error) { } if repoFlagPathExists { repoPath = repoFlag + } else { + c.RepoSlug = repoFlag } } @@ -90,12 +92,6 @@ func InitCommand(cmd *cli.Command) (*TeaContext, error) { remoteFlag = config.GetPreferences().FlagDefaults.Remote } - if repoPath == "" { - if repoPath, err = os.Getwd(); err != nil { - return nil, err - } - } - // Create env login before repo context detection so it participates in remote URL matching var extraLogins []config.Login envLogin := GetLoginByEnvVar() @@ -108,17 +104,20 @@ func InitCommand(cmd *cli.Command) (*TeaContext, error) { // try to read local git repo & extract context: if repoFlag specifies a valid path, read repo in that dir, // otherwise attempt PWD. if no repo is found, continue with default login - if c.LocalRepo, c.Login, c.RepoSlug, err = contextFromLocalRepo(repoPath, remoteFlag, extraLogins); err != nil { - if err == errNotAGiteaRepo || err == gogit.ErrRepositoryNotExists { - // we can deal with that, commands needing the optional values use ctx.Ensure() - } else { - return nil, err + if c.RepoSlug == "" { + if repoPath == "" { + if repoPath, err = os.Getwd(); err != nil { + return nil, err + } } - } - if len(repoFlag) != 0 && !repoFlagPathExists { - // if repoFlag is not a valid path, use it to override repoSlug - c.RepoSlug = repoFlag + if c.LocalRepo, c.Login, c.RepoSlug, err = contextFromLocalRepo(repoPath, remoteFlag, extraLogins); err != nil { + if err == errNotAGiteaRepo || err == gogit.ErrRepositoryNotExists { + // we can deal with that, commands needing the optional values use ctx.Ensure() + } else { + return nil, err + } + } } // If env vars are set, always use the env login (but repo slug was already diff --git a/modules/context/context_test.go b/modules/context/context_test.go index 9b73f88..2c8ea43 100644 --- a/modules/context/context_test.go +++ b/modules/context/context_test.go @@ -4,9 +4,14 @@ package context import ( + "os" + "os/exec" "testing" "code.gitea.io/tea/modules/config" + + "github.com/stretchr/testify/require" + "github.com/urfave/cli/v3" ) func Test_MatchLogins(t *testing.T) { @@ -65,3 +70,47 @@ func Test_MatchLogins(t *testing.T) { }) } } + +func TestInitCommand_WithRepoSlugSkipsLocalRepoDetection(t *testing.T) { + tmpDir := t.TempDir() + config.SetConfigForTesting(config.LocalConfig{ + Logins: []config.Login{{ + Name: "test-login", + URL: "https://gitea.example.com", + Token: "token", + User: "login-user", + Default: true, + }}, + }) + + cmd := exec.Command("git", "init", "--object-format=sha256", tmpDir) + cmd.Env = os.Environ() + require.NoError(t, cmd.Run()) + + oldWd, err := os.Getwd() + require.NoError(t, err) + require.NoError(t, os.Chdir(tmpDir)) + t.Cleanup(func() { + require.NoError(t, os.Chdir(oldWd)) + }) + + cliCmd := cli.Command{ + Name: "branches", + Flags: []cli.Flag{ + &cli.StringFlag{Name: "login"}, + &cli.StringFlag{Name: "repo"}, + &cli.StringFlag{Name: "remote"}, + &cli.StringFlag{Name: "output"}, + }, + } + require.NoError(t, cliCmd.Set("repo", "owner/repo")) + + ctx, err := InitCommand(&cliCmd) + require.NoError(t, err) + require.Equal(t, "owner", ctx.Owner) + require.Equal(t, "repo", ctx.Repo) + require.Equal(t, "owner/repo", ctx.RepoSlug) + require.Nil(t, ctx.LocalRepo) + require.NotNil(t, ctx.Login) + require.Equal(t, "test-login", ctx.Login.Name) +}