fix(glrepo): skip fork candidates without local remotes

Description

With prompts disabled, glab mr create can panic when a local fork's parent is itself a fork: HeadRepo selects the API-only parent and returns a typed-nil *Remote. Skip fork candidates whose local remote lookup fails, and preserve the existing first-remote fallback.

Add a fork-of-a-fork regression that asserts a non-nil head repository with the expected name and host. This change addresses #8567 (closed); the distinct unrelated-fork selection behavior in #8382 remains outside its scope.

Resolves #8567 (closed)

How has this been tested?

  • The new regression failed before the resolver change.
  • Test_HeadRepo, required Lefthook pre-commit and pre-push checks passed.
  • make check: 5,502 tests passed, 9 skipped. Full lint reported six existing findings in untouched documentation, Duo ask, and dependency-firewall files; lint against this branch's changes passed. The same findings were reproduced on unchanged main.
  • Tested on macOS arm64 with Go 1.27.1.

AI assistance was used to prepare the change. The code received independent review and local testing.

/copy_metadata #8567 (closed)

Merge request reports

Loading
Loading