Skip to content

Commit 2129936

Browse files
committed
Fix up regex to escape dot in URL
1 parent 28b3b2c commit 2129936

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

pkg/cmd/pr/create/create.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ func createRun(opts *CreateOptions) error {
431431
pushTries := 0
432432
maxPushTries := 3
433433
for {
434-
regexp := regexp.MustCompile("^remote: (|Create a pull request for '.*' on GitHub by visiting:.*|.*https://github.com/.*/pull/new/.*)$")
434+
regexp := regexp.MustCompile("^remote: (|Create a pull request for '.*' on GitHub by visiting:.*|.*https://github\\.com/.*/pull/new/.*)$")
435435
cmdErr := NewRegexWriter(os.Stderr, regexp, "")
436436
cmdOut := os.Stdout
437437
if err := git.Push(headRemote.Name, fmt.Sprintf("HEAD:%s", headBranch), cmdOut, cmdErr); err != nil {

pkg/cmd/pr/create/regex_writer_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ func Test_Write(t *testing.T) {
114114
remote:
115115
output: more information
116116
`),
117-
regexp: regexp.MustCompile("^remote: (|Create a pull request for '.*' on GitHub by visiting:.*|.*https://github.com/.*/pull/new/.*)$"),
117+
regexp: regexp.MustCompile("^remote: (|Create a pull request for '.*' on GitHub by visiting:.*|.*https://github\\.com/.*/pull/new/.*)$"),
118118
repl: "",
119119
},
120120
output: output{

0 commit comments

Comments
 (0)