Fix up regex to escape dot in URL

This commit is contained in:
Sam Coe 2020-10-01 12:45:33 +02:00
parent 28b3b2c9e7
commit 212993632b
No known key found for this signature in database
GPG key ID: 8E322C20F811D086
2 changed files with 2 additions and 2 deletions

View file

@ -431,7 +431,7 @@ func createRun(opts *CreateOptions) error {
pushTries := 0
maxPushTries := 3
for {
regexp := regexp.MustCompile("^remote: (|Create a pull request for '.*' on GitHub by visiting:.*|.*https://github.com/.*/pull/new/.*)$")
regexp := regexp.MustCompile("^remote: (|Create a pull request for '.*' on GitHub by visiting:.*|.*https://github\\.com/.*/pull/new/.*)$")
cmdErr := NewRegexWriter(os.Stderr, regexp, "")
cmdOut := os.Stdout
if err := git.Push(headRemote.Name, fmt.Sprintf("HEAD:%s", headBranch), cmdOut, cmdErr); err != nil {

View file

@ -114,7 +114,7 @@ func Test_Write(t *testing.T) {
remote:
output: more information
`),
regexp: regexp.MustCompile("^remote: (|Create a pull request for '.*' on GitHub by visiting:.*|.*https://github.com/.*/pull/new/.*)$"),
regexp: regexp.MustCompile("^remote: (|Create a pull request for '.*' on GitHub by visiting:.*|.*https://github\\.com/.*/pull/new/.*)$"),
repl: "",
},
output: output{