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

Unable to checkout by an annotated tag #954

@anisimovsergey

Description

@anisimovsergey

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions