python / cherry-picker

🐍🍒⛏ Utility script for backporting/cherry-picking CPython changes from master into one of the maintenance branches.
Apache License 2.0
46 stars 38 forks source link

Username detection fails with a trailing slash #109

Closed AA-Turner closed 5 months ago

AA-Turner commented 5 months ago

I have my remote origin set to https://github.com/AA-Turner/cpython/.

PS> git remote -v
origin  https://github.com/AA-Turner/cpython/ (fetch)
origin  https://github.com/AA-Turner/cpython/ (push)
upstream        https://github.com/python/cpython/ (fetch)
upstream        https://github.com/python/cpython/ (push)

cherry_picker runs git config --get remote.origin.url, which returns the above url, and then runs username = result.replace(":", "/").split("/")[-2]. This returns cpython, which means that I have to manually edit the URL on every backport.

cherry_picker should instead trim any trailing slash.

A