Skip to content

gix cannot clone a repo with a branch called HEAD #1428

@LawnGnome

Description

@LawnGnome

Current behavior 😯

Attempting to clone a repository that has a branch called HEAD results in this error:

$ gix clone https://github.com/promised-ai/rv
Error: Found 1 issue that prevents the refspec mapping to be used: 
	Conflicting destination "refs/remotes/origin/HEAD" would be written by refs/heads/HEAD ("+refs/heads/*:refs/remotes/origin/*"), HEAD ("HEAD:refs/remotes/origin/HEAD")

(I have absolutely no idea how this happened in that repo in the first place; I'm not affiliated with it in any way. But the branch does exist, according to GitHub.)

Expected behavior 🤔

A clone, presumably.

Git behavior

Git does manage to perform the clone:

$ git clone https://github.com/promised-ai/rv
Cloning into 'rv'...
remote: Enumerating objects: 7170, done.
remote: Counting objects: 100% (1619/1619), done.
remote: Compressing objects: 100% (534/534), done.
remote: Total 7170 (delta 1124), reused 1447 (delta 1032), pack-reused 5551
Receiving objects: 100% (7170/7170), 1.99 MiB | 4.96 MiB/s, done.
Resolving deltas: 100% (5275/5275), done.

Steps to reproduce 🕹

gix clone https://github.com/promised-ai/rv

Metadata

Metadata

Assignees

No one assigned

    Labels

    acknowledgedan issue is accepted as shortcoming to be fixed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions