From 97eadcbec0b09b1228c951f49494e4055cd14c30 Mon Sep 17 00:00:00 2001 From: GyuYong Jung Date: Tue, 19 Jul 2016 02:18:16 +0900 Subject: [PATCH] Skip when a url ends with `.patch`, `.diff` (#308) --- src/adapters/github.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/adapters/github.js b/src/adapters/github.js index f4e913f..bfa59c1 100644 --- a/src/adapters/github.js +++ b/src/adapters/github.js @@ -123,9 +123,9 @@ class GitHub extends Adapter { return cb() } - // (username)/(reponame)[/(type)] - const match = window.location.pathname.match(/([^\/]+)\/([^\/]+)(?:\/([^\/]+))?/) - if (!match) { + // (username)/(reponame)[/(type)][.*][.(patch|diff)] + const match = window.location.pathname.match(/([^\/]+)\/([^\/]+)(?:\/([^\/]+))?(?:\/[^.]+)?(?:\.(patch|diff))?$/i) + if (!match || match[4]) { return cb() }