mirror of
https://gitea.com/gitea/tea.git
synced 2026-10-26 11:01:25 +01:00
fix: address verified review findings (completion-target-ref-1)
Signed-off-by: bircni <bircni@icloud.com>
This commit is contained in:
10 files changed
+166
-34
No files matched your search
@@ -302,8 +302,11 @@ func (a *application) agreesWithRepoFlag(req targetRequest, hosts map[string]set
|
||||
}
|
||||
selected, selectedErr := settings.ParseRepository(req.repo, hosts)
|
||||
explicit, explicitErr := settings.ParseRepository(a.options.repo, hosts)
|
||||
if selectedErr != nil || explicitErr != nil {
|
||||
return nil // Resolution reports the invalid one.
|
||||
if explicitErr != nil {
|
||||
return clierr.Wrap(clierr.Usage, explicitErr) // The argument's repository replaces --repo, so nothing else parses it.
|
||||
}
|
||||
if selectedErr != nil {
|
||||
return nil // Resolution reports the invalid argument.
|
||||
}
|
||||
sameHost := selected.Host == "" || explicit.Host == "" || selected.Host == explicit.Host
|
||||
sameRepo := strings.EqualFold(selected.Name, explicit.Name) && (explicit.Owner == "" || strings.EqualFold(selected.Owner, explicit.Owner))
|
||||
|
||||
Reference in new issue
Block a user