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

Git PlainClone is throwing reference delta not found error #495

Closed
ajaykn opened this issue Mar 21, 2022 · 7 comments
Closed

Git PlainClone is throwing reference delta not found error #495

ajaykn opened this issue Mar 21, 2022 · 7 comments

Comments

@ajaykn
Copy link

ajaykn commented Mar 21, 2022

I am trying to clone repo:
https://github.com/OctopusDeploy/install-octopus-cli-action

And seeing the error reference delta not found

git.PlainClone is failing

r, err := git.PlainClone("temp/"+repo_nwo, true, &git.CloneOptions{
    SingleBranch: false,
    URL:          "https://github.com/" + repo_nwo,
    Progress:     os.Stdout,
})

Output:

Enumerating objects: 8163, done.
Counting objects: 100% (1465/1465), done.
Compressing objects: 100% (854/854), done.
Total 8163 (delta 811), reused 964 (delta 515), pack-reused 6698
reference delta not found

git.Clone is working fine

storage := memory.NewStorage()
r, err := git.Clone(storage, nil, &git.CloneOptions{
    SingleBranch: false,
    URL:          "https://github.com/" + repo_nwo,
    Progress:     os.Stdout,
})

Output:

Enumerating objects: 8163, done.
Counting objects: 100% (1465/1465), done.
Compressing objects: 100% (856/856), done.
Total 8163 (delta 811), reused 962 (delta 513), pack-reused 6698
@ajaykn
Copy link
Author

ajaykn commented Mar 21, 2022

@mcuadros Any help on this ?
reaching out, since you have merged one PR: #392 on this reference delta not found issue

@ZauberNerd
Copy link
Contributor

I can reproduce your issue with the latest master, my PR (#485 ) fixes it:

package main

import (
  "os"
  "github.com/go-git/go-git/v5"
)

func main() {
  _, err := git.PlainClone("temp/octopus", true, &git.CloneOptions{
    SingleBranch: false,
    URL:          "https://github.com/OctopusDeploy/install-octopus-cli-action",
    Progress:     os.Stdout,
  })

  if err != nil {
    println(err.Error())
  }
}

@ajaykn
Copy link
Author

ajaykn commented Mar 21, 2022

Thanks @ZauberNerd, cross checked and yeah your PR fix is solving the issue.

Hopefully, your PR will be merged soon and will get a new release of go-git.

@kaiohenricunha
Copy link

I ran into the same issue and @ZauberNerd 's PR solved it.

Thanks!

But, why is it taking so long for PRs to be merged?

@kyparisisg
Copy link

kyparisisg commented Oct 3, 2022

Hey folks, I am running to the same issue here!
Any thoughts when the PR will get merged?
Or if I can use any workarounds?
Thank you!

oshoval added a commit to oshoval/cluster-network-addons-operator that referenced this issue Dec 7, 2022
Fixes "reference delta not found" error.
Based on go-git/go-git#485
see go-git/go-git#495 (comment)

Signed-off-by: Or Shoval <oshoval@redhat.com>
brygotti added a commit to SDPCoachMe/SDP-2023 that referenced this issue Mar 23, 2023
…to match dependencies version

This tries to fix both issues from last commit: newer dependencies version no longer could build without also updating kotlin version, and Cirrus CI failed to clone the repo due to an obscure bug in their git implementation (go-git/go-git#495). Trying to reduce repo size by removing libraries from local maven repository at /libs, hoping it will fix the issue.
@AriehSchneier
Copy link
Contributor

@pjbgf - it looks like this should now be closed as fixed by #485

@pjbgf
Copy link
Member

pjbgf commented May 8, 2023

Nice one @AriehSchneier. Closing as per #485.

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

No branches or pull requests

6 participants