mirror of
https://gitea.com/gitea/tea.git
synced 2026-10-26 11:01:25 +01:00
fix: tighten error classification and pull request selection
Only Gitea's archived-repository messages mean the repository is archived, so an archived label is no longer reported as one. Refused POSTs to the organization, team, user and SSH key collections name the resource they would have created, and the existing pull request is looked up with escaped branch names. pullSelector without an argument refuses an explicit --repo, like gh: the checked-out branch says nothing about another repository. Signed-off-by: bircni <bircni@icloud.com>
This commit is contained in:
7 files changed
+41
-23
No files matched your search
@@ -135,6 +135,11 @@ func TestPullSelectorDefaultsToTheCheckedOutBranch(t *testing.T) {
|
||||
require.Equal(t, tc.want, n)
|
||||
})
|
||||
}
|
||||
a, _ := refApplication(t, branch("feat/two", nil))
|
||||
a.options.repo = "alice/project"
|
||||
_, _, err := a.pullSelector(commandContext(), nil)
|
||||
require.Equal(t, clierr.Usage, clierr.ExitCode(err))
|
||||
require.EqualError(t, err, "pass a pull request number, URL or branch with --repo")
|
||||
}
|
||||
|
||||
func TestPullSelectorAcceptsNumbersURLsAndBranches(t *testing.T) {
|
||||
|
||||
Reference in new issue
Block a user