I am using the library pygit2 to implement a git module on my project. Right now i'm blocked by these 2 scenarios : - the deletion of a tag than a push - the deletion of a branch than a push
this is what i'm trying to do :
>>> branch = repo.lookup_branch('origin/1249something', pygit2.GIT_BRANCH_REMOTE)
>>> branch
<_pygit2.Branch object at 0xb7350270>
>>> branch.delete()
>>> branch_to_push = 'refs/remotes/origin/1249something'
>>> pusher = pygit2.Signature('test TESTSSSSSSSS', 'test-test1@site.com')
>>> message = "just test message"
>>> remote_repo = repo.remotes[0]
>>> remote_repo.push(branch_to_push, pusher, message)
and this is the result i get :
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/pygit2/remote.py", line 358, in push
check_error(err)
File "/usr/local/lib/python2.7/dist-packages/pygit2/errors.py", line 56, in check_error
raise GitError(message)
_pygit2.GitError: src refspec 'refs/remotes/origin/1249something' does not match any existing object