Skip to content
This repository has been archived by the owner on Sep 11, 2020. It is now read-only.

Error: object not found when git pull origin refs/tags/mytag #1229

Open
miltalex opened this issue Oct 21, 2019 · 1 comment
Open

Error: object not found when git pull origin refs/tags/mytag #1229

miltalex opened this issue Oct 21, 2019 · 1 comment

Comments

@miltalex
Copy link

Hi,

I get the Error: object not found when I try to git pull from a tag:

err = w.Pull(&git.PullOptions{
		RemoteName:    "origin",
		ReferenceName: plumbing.ReferenceName("/refs/tags/mytag"),
	})

Any help appreciated.

@miltalex miltalex changed the title Error: object not found when git pull origin refs/tags/* Error: object not found when git pull origin refs/tags/mytag Oct 21, 2019
@tshak
Copy link

tshak commented Oct 29, 2019

Are you using a shallow clone? If so shallow clones are broken (#1143). Even without shallow cloning, this can still happen on occasion. This appears related to #1151. Here's my error handling:

// plumbing.ErrObjectNotFound is a work around for https://github.com/src-d/go-git/issues/1151
if err != nil && err != git.NoErrAlreadyUpToDate && err != plumbing.ErrObjectNotFound {
  return err
}

I hope this helps.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants