I am cloning a repository in single branch mode with a branch name that contains a hash/number sign (#) into name. And get an error.
Steps to reproduce (created a public github repository for that):
_, err := git.PlainClone("/tmp/repo", false, &git.CloneOptions{
URL: "git@github.com:jkblume/gogit-hashtag-bug.git",
ReferenceName: plumbing.ReferenceName("refs/heads/branch#name"),
SingleBranch: true,
})
fmt.Println(err.Error())
The command fails with error message: 'malformed refspec, separators are wrong' in file config/refspec.go line 35.