spacedentist / spr

Submit pull requests for individual, amendable, rebaseable commits to GitHub
https://getcord.github.io/spr/
MIT License
391 stars 41 forks source link

Remove Pull Request field in commit message if it doesn't parse #24

Closed sven-of-cord closed 2 years ago

sven-of-cord commented 2 years ago

This is a tiny fix. If a commit message contains a Pull Request field, but it's empty or otherwise unparseable, then it's interpreted as if it wasn't present. This diff makes it so, that we remove that field if and when we write the commit message back.

Test Plan: edit a commit message to have an empty (but present) Pull Request field, then run spr format and see it was removed. Also try with content in the Pull Request field that doesn't reference a Pull Request in a valid way.