From e8325b58a69486a71b8d0830c3d0014717f3b1c2 Mon Sep 17 00:00:00 2001 From: claudiahdz Date: Thu, 3 Oct 2019 13:56:21 +0300 Subject: [PATCH] fix: updated pathmatch for gitlab PR-URL: https://github.com/npm/hosted-git-info/pull/51 Credit: @mikemimik Close: #51 Reviewed-by: @isaacs --- git-host-info.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-host-info.js b/git-host-info.js index 4dec801..8147e33 100644 --- a/git-host-info.js +++ b/git-host-info.js @@ -25,7 +25,7 @@ var gitHosts = module.exports = { 'bugstemplate': 'https://{domain}/{user}/{project}/issues', 'httpstemplate': 'git+https://{auth@}{domain}/{user}/{projectPath}.git{#committish}', 'tarballtemplate': 'https://{domain}/{user}/{project}/repository/archive.tar.gz?ref={committish}', - 'pathmatch': /^[/]([^/]+)[/](?!.*\/-\/)(.+?)(?:[.]git|[/])?$/ + 'pathmatch': /^[/]([^/]+)[/]((?!.*(\/-\/|\/repository\/archive\.tar\.gz\?=.*|\/repository\/[^/]+\/archive.tar.gz$)).*?)(?:[.]git|[/])?$/ }, gist: { 'protocols': [ 'git', 'git+ssh', 'git+https', 'ssh', 'https' ],