Fix recycled pointer for info.RemoteInfo
This commit is contained in:
4
internal/cache/projects_alias.go
vendored
4
internal/cache/projects_alias.go
vendored
@ -50,7 +50,9 @@ func (c *Cache) AliasesByProjectString(remotes ...string) string {
|
||||
w.Init(&str, 10, 0, 0, ' ', tabwriter.AlignRight)
|
||||
|
||||
for _, p := range c.GetProjectsWithAliases() {
|
||||
if !slices.Contains(remotes, p.Remote) {
|
||||
if p == nil {
|
||||
continue
|
||||
} else if len(remotes) > 0 && !slices.Contains(remotes, p.Remote) {
|
||||
continue
|
||||
}
|
||||
var pa string
|
||||
|
@ -15,10 +15,10 @@ const (
|
||||
// Globally shared info for all remote types
|
||||
// Stub package to prevent import cycle
|
||||
type RemoteInfo struct {
|
||||
Ctx context.Context
|
||||
Host string
|
||||
Name string
|
||||
Token string
|
||||
Type string
|
||||
CloneProto CloneProto
|
||||
Ctx context.Context // Base context for all API calls
|
||||
Host string // Host as URL with protocol (e.g. https://gitlab.com)
|
||||
Name string // Human-friendly name for remote
|
||||
Token string // API token for remote
|
||||
Type string // Remote type (e.g. gitlab, gitea)
|
||||
CloneProto CloneProto // CloneProto (ssh or http) determines what url to use for git clone
|
||||
}
|
||||
|
Reference in New Issue
Block a user