Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Attempting to remove tag results in exception #260

Closed
@terminalmage

Description

@terminalmage

I am attempting to use GitPython to remove a tag from a local clone which does not exist in the remote repo. After fetching a remote, remote.stale_refs shows the following stale tag: <git.RemoteReference "refs/remotes/refs/tags/new_tag">. This already seems to be a problem, as the path to the tag should be refs/tags/new_tag. When I run ref.delete(repo, ref) (where ref is the git.RemoteReference and repo is its corresponding git.Repo instance), I get the following exception:

GitCommandError: 'git branch -d -r refs/tags/new_tag' returned exit status 1: error: remote branch 'refs/tags/new_tag' not found.

Additionally, ref.name is set to refs/tags/new_tag, so at least that much looks correct.

My GitPython version is 0.3.2.1. I have not yet had a chance to test with a newer version.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions