Changeset - a9bcdc438d69
stable
0
5
0
Grafted from: fa57a4e0d1fd
git: fix pull request deletion - don't crash on deleting refs to PR heads
The refs name was passed as unicode string, and that would cause failure like:
File ".../site-packages/dulwich/repo.py", line 720, in __delitem__
if name.startswith(b"refs/") or name == b"HEAD":
TypeError: startswith first arg must be str or a tuple of str, not bytes
Fixed by correctly passing the ref name as bytes, as we do when creating the PR
refs.
Tests added by Mads Kiilerich.
The refs name was passed as unicode string, and that would cause failure like:
File ".../site-packages/dulwich/repo.py", line 720, in __delitem__
if name.startswith(b"refs/") or name == b"HEAD":
TypeError: startswith first arg must be str or a tuple of str, not bytes
Fixed by correctly passing the ref name as bytes, as we do when creating the PR
refs.
Tests added by Mads Kiilerich.
5 files changed with 30 insertions and 3 deletions:
0 comments (0 inline, 0 general)
0 comments (0 inline, 0 general)