Skip when a url ends with `.patch`, `.diff` (#308)

This commit is contained in:
GyuYong Jung 2016-07-19 02:18:16 +09:00 committed by Buu Nguyen
parent bb5979d425
commit 97eadcbec0
1 changed files with 3 additions and 3 deletions

View File

@ -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()
}