Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
magit-insert-remote-branches: Skip HEAD if not symref
magit-insert-remote-branches strips the remote name from the short refname (e.g., "origin/foo") when magit-refs-show-remote-prefix is nil. That can trigger an error if 1) the remote is mis-configured in a way where for-each-ref reports an empty symref field for the HEAD ref and 2) the Git version is recent enough to shorten the HEAD ref to "$remote" instead of "$remote/HEAD". Note that mis-configuring a remote in such a way isn't as easy as just checking out a detached HEAD in the remote repo (git-clone won't create the HEAD ref in that case) or creating an ambiguous refs/heads/HEAD branch in the remote repo (git-clone will still use the regular HEAD symref in that case). The key pieces of the problematic remotes reported in gh-5092 are 1) an ambiguous refs/heads/HEAD and 2) the regular HEAD symref pointing to a ref that does not exist.
- Loading branch information