diff options
Diffstat (limited to 'misc/chrome/gophertool/gopher.js')
-rw-r--r-- | misc/chrome/gophertool/gopher.js | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/misc/chrome/gophertool/gopher.js b/misc/chrome/gophertool/gopher.js index 686e2175f9..c09c4ef10c 100644 --- a/misc/chrome/gophertool/gopher.js +++ b/misc/chrome/gophertool/gopher.js @@ -3,7 +3,8 @@ // license that can be found in the LICENSE file. var numericRE = /^\d+$/; -var commitRE = /^(?:\d+:)?([0-9a-f]{6,20})$/; // e.g "8486:ab29d2698a47" or "ab29d2698a47" +var commitRE = /^(?:\d+:)?([0-9a-f]{6,40})$/; // e.g "8486:ab29d2698a47" or "ab29d2698a47" +var gerritChangeIdRE = /^I[0-9a-f]{4,40}$/; // e.g. Id69c00d908d18151486007ec03da5495b34b05f5 var pkgRE = /^[a-z0-9_\/]+$/; function urlForInput(t) { @@ -21,6 +22,10 @@ function urlForInput(t) { return "https://golang.org/cl/" + t; } + if (gerritChangeIdRE.test(t)) { + return "http://golang.org/cl/" + t; + } + var match = commitRE.exec(t); if (match) { return "https://golang.org/change/" + match[1]; |