robertdfrench / git-pr

Pull requests without Git(Hub|Lab)
GNU General Public License v3.0
0 stars 1 forks source link

Support hexadecimal iteration numbers for branches. Fixes #36 #47

Closed robertdfrench closed 3 years ago

robertdfrench commented 3 years ago

Previously, the idea of the "iteration number" for a PR was an increasing sequence of decimal numbers. Now that we had adopted the idea of using the base commit's hash as the "iteration number", we need to be able to list branches that may include hexadecimal values.

I changed one of the unit tests to look for something like pr-name/3f3f3f instead of pr-name/3, and then I played around with the Regex until the tests all passed again. Ultimately, the solution was to use a "character class" consisting of a-f together with \d (digit), and to keep the existing quantifier.