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

Unable to checkout by an annotated tag #954

Closed
anisimovsergey opened this issue Sep 9, 2018 · 0 comments
Closed

Unable to checkout by an annotated tag #954

anisimovsergey opened this issue Sep 9, 2018 · 0 comments
Labels

Comments

@anisimovsergey
Copy link

anisimovsergey commented Sep 9, 2018

Version: v4.6.0
Revision: 7b6c126

My repository has several tags and some of them are annotated and some aren't. When I'm trying to do the following:

	tags, err := repo.Tags()
	if err != nil {
		return err
	}

	w, err := repo.Worktree()
	if err != nil {
		return err
	}

	err = tags.ForEach(func(t *plumbing.Reference) error {
		err = w.Checkout(&git.CheckoutOptions{Hash: t.Hash()})
		if err != nil {
			fmt.Printf("unable to check out commit %s", t.Hash())
		} 
		return nil
	})

I'm getting this error: "object not found"

I searched among the issues and found #772, there is a PR for solving it created by @novas0x2a but I've got a feeling that the problem might be deeper.

@anisimovsergey anisimovsergey changed the title Unable to checkout by annotated tag Unable to checkout by an annotated tag Sep 9, 2018
@smola smola added the bug label Sep 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants