lab132 / buildbot-gitea

Buildbot plugin for integration with gitea.
MIT License
62 stars 21 forks source link

Remove .git from ssh_url_match to get a valid repository name. #8

Closed bfueldner closed 4 years ago

bfueldner commented 4 years ago

Current ssh_url_match would always include trailing '.git' from SSH URL in match, which leads to an invalid repository name on REST access. To avoid this, I propose stripping the trailing '.git' away from ssh_url with re.sub().

pampersrocker commented 4 years ago

I see, thanks for spotting this, however I would just make the repo_name group greedy (i.e. add an ? after the +) and not introduce an extra sub, see here for an example: https://regex101.com/r/EWzUKJ/2/

bfueldner commented 4 years ago

@pampersrocker Thanks for the hint! I did not know the trick how to take the greediness out of this rule. I agree with you simpler solution.

pampersrocker commented 4 years ago

I've squashed both commits and clarified the commit message.

Thank you for the contribution!