From 212993632baaa80c760040b81deb63bbd4cfc47a Mon Sep 17 00:00:00 2001 From: Sam Coe Date: Thu, 1 Oct 2020 12:45:33 +0200 Subject: [PATCH] Fix up regex to escape dot in URL --- pkg/cmd/pr/create/create.go | 2 +- pkg/cmd/pr/create/regex_writer_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/cmd/pr/create/create.go b/pkg/cmd/pr/create/create.go index e52749e1b..12a1a9f2b 100644 --- a/pkg/cmd/pr/create/create.go +++ b/pkg/cmd/pr/create/create.go @@ -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 { diff --git a/pkg/cmd/pr/create/regex_writer_test.go b/pkg/cmd/pr/create/regex_writer_test.go index bf57c3b48..e228c58aa 100644 --- a/pkg/cmd/pr/create/regex_writer_test.go +++ b/pkg/cmd/pr/create/regex_writer_test.go @@ -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{