diff --git a/CHANGELOG.md b/CHANGELOG.md index 7d7bee91..08f3529d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,16 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. + +## [3.0.7](https://github.com/npm/hosted-git-info/compare/v3.0.6...v3.0.7) (2020-10-15) + + +### Bug Fixes + +* correctly filter out urls for tarballs in gitlab ([eb5bd5a](https://github.com/npm/hosted-git-info/commit/eb5bd5a)), closes [#69](https://github.com/npm/hosted-git-info/issues/69) + + + ## [3.0.6](https://github.com/npm/hosted-git-info/compare/v3.0.5...v3.0.6) (2020-10-12) diff --git a/git-host-info.js b/git-host-info.js index ffd401de..da3348fa 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': /^[/]([^/]+)[/]((?!.*(\/-\/|\/repository\/archive\.tar\.gz\?=.*|\/repository\/[^/]+\/archive.tar.gz$)).*?)(?:[.]git|[/])?$/ + 'pathmatch': /^\/([^/]+)\/((?!.*(\/-\/|\/repository(\/[^/]+)?\/archive\.tar\.gz)).*?)(?:\.git|\/)?$/ }, gist: { 'protocols': [ 'git', 'git+ssh', 'git+https', 'ssh', 'https' ], diff --git a/package-lock.json b/package-lock.json index 6b652119..3f8a6352 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "hosted-git-info", - "version": "3.0.6", + "version": "3.0.7", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 7d1314c4..2a0062c8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hosted-git-info", - "version": "3.0.6", + "version": "3.0.7", "description": "Provides metadata and conversions from repository urls for Github, Bitbucket and Gitlab", "main": "index.js", "repository": { diff --git a/test/fixtures/gitlab.js b/test/fixtures/gitlab.js index 33053da2..928510cb 100644 --- a/test/fixtures/gitlab.js +++ b/test/fixtures/gitlab.js @@ -24,6 +24,16 @@ module.exports = [ label: 'https.tar', isUndefined: true }, + { + host: function (p) { return 'https://' + p.domain + '/' + p.owner + '/' + p.project + '/repository/archive.tar.gz?ref=' + p.branch }, + label: 'https.tar', + isUndefined: true + }, + { + host: function (p) { return 'https://' + p.domain + '/' + p.owner + '/' + p.project + '/repository/archive.tar.gz' }, + label: 'https.tar', + isUndefined: true + }, { host: function (p) { return 'git+https://' + p.domain + '/' + p.owner + '/' + p.project }, label: 'git+https' diff --git a/test/gitlab.js b/test/gitlab.js index cd0f7d83..94d9a396 100644 --- a/test/gitlab.js +++ b/test/gitlab.js @@ -17,7 +17,7 @@ var testFixtures = function (t, params, fixtures) { tt.is(hostinfo, undefined) tt.end() }) - break + continue } t.test('hostinfo.https', function (tt) {