push-to-pull-request: Fix regex usage in parsing remote.

This replaces ad4617c95 with a different fix for the same issue:
instead of stripping the `.git` off separately, we can just correct
the regex, using `+?` to fix our stepping in a classic regex pitfall.
This commit is contained in:
Greg Price
2018-06-01 16:36:56 -07:00
parent e891078d94
commit 8e81ca0fb2

View File

@@ -28,9 +28,9 @@ fi
remote_url="$(git config remote."$remote".url)"
repo_fq="$(echo "$remote_url" | perl -lne 'print $1 if (
m, ^ git\@github\.com:
([^/]+ / [^/]+)
(\.git)?
$ ,x )' | sed 's/.git$//')"
([^/]+ / [^/]+?)
(?:\.git)?
$ ,x )')"
if [ -z "$repo_fq" ]; then
# We're pretty specific about what we expect the URL to look like;