Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSH cloning returning "empty git-upload-pack given" #157

Closed
bmiller2807 opened this issue Aug 26, 2020 · 2 comments · Fixed by #932
Closed

SSH cloning returning "empty git-upload-pack given" #157

bmiller2807 opened this issue Aug 26, 2020 · 2 comments · Fixed by #932

Comments

@bmiller2807
Copy link

I am not sure if this is an issue, bug , or lack of understanding, but, when im trying to clone a repo using ssh , i am recieving this error "empty git-upload-pack given". Any ideas why ? A snippet :

                      sshPath := privateKeyFile
		sshKey, _ := ioutil.ReadFile(sshPath)
		publicKey, keyError := ssh.NewPublicKeys(user, []byte(sshKey), password)
		if keyError != nil {
			fmt.Println(keyError)
		}

		repo, err = git.PlainClone(cloneDir, false, &git.CloneOptions{
			URL:               scanRequest.RepoURL,
			Progress:          os.Stdout,
			Auth:              publicKey,
			ReferenceName:     plumbing.ReferenceName(fmt.Sprintf("refs/heads/%s", scanRequest.Branch)),
			SingleBranch:      true,
			RecurseSubmodules: git.DefaultSubmoduleRecursionDepth,
		})
		if err != nil {
			fmt.Sprintf("%s %s %s", "07", "Clone failed: %s\n", err.Error())
			return
		}
@ChandlerSwift
Copy link

You don't happen to be cloning from Azure Devops do you? There's a known issue (they only implement the git v2 protocol -- #64) that seems to give the "empty git-upload-pack" error you've been seeing.

@bmiller2807
Copy link
Author

Thank you @ChandlerSwift for the reply, hopefully this will be added soon.

aymanbagabas added a commit to aymanbagabas/go-git that referenced this issue Nov 16, 2023
If we have all what we asked for, finish the session and handle error.

This is equivalent of git "Already up to date." message.

Fixes: go-git#328
Fixes: go-git#638
Fixes: go-git#157
aymanbagabas added a commit to aymanbagabas/go-git that referenced this issue Nov 16, 2023
If we have all what we asked for, finish the session and handle error.

This is equivalent of git "Already up to date." message.

Fixes: go-git#328
Fixes: go-git#638
Fixes: go-git#157
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants