mirror of
https://gitea.com/gitea/tea.git
synced 2026-10-26 11:01:25 +01:00
fix: page hint for comment list, keep SSH settings on re-login, hard-link-free downloads, stable OWNER/REPO#N instance (follow gh)
Signed-off-by: bircni <bircni@icloud.com>
This commit is contained in:
11 files changed
+154
-10
No files matched your search
@@ -235,3 +235,20 @@ func TestExpandMeUsesTheLoginTeaActsAs(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, "bob", resolved.expandMe("@me"))
|
||||
}
|
||||
|
||||
func TestResolveRefsKeepsTheReferenceThatNamesAnInstance(t *testing.T) {
|
||||
a, serverURL := refApplication(t, nil)
|
||||
// GITEA_TOKEN belongs to serverURL, so selecting the other instance is what fails here.
|
||||
other := strings.Replace(serverURL, "127.0.0.1", "localhost", 1)
|
||||
const mismatch = "matching the selected instance"
|
||||
for _, raws := range [][]string{
|
||||
{other + "/bob/tool/issues/1", "bob/tool#2"},
|
||||
{"bob/tool#2", other + "/bob/tool/issues/1"},
|
||||
} {
|
||||
_, _, err := a.resolveRefs(commandContext(), raws, issueRef)
|
||||
require.ErrorContains(t, err, mismatch, raws)
|
||||
}
|
||||
a.options.repo = other + "/bob/tool"
|
||||
_, _, err := a.resolveRef(commandContext(), "bob/tool#2", issueRef)
|
||||
require.ErrorContains(t, err, mismatch, "an argument without an instance keeps the --repo one")
|
||||
}
|
||||
Reference in new issue
Block a user