From 002865f4c098fe8afb51826eb8e5d7380b0c8c5e Mon Sep 17 00:00:00 2001 From: quaff Date: Wed, 16 Oct 2024 00:35:14 -0700 Subject: [PATCH] fix: add more false test cases relating to master and branches --- src/serviceProviders/sourcehut.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/serviceProviders/sourcehut.js b/src/serviceProviders/sourcehut.js index 1c62271..612ee85 100644 --- a/src/serviceProviders/sourcehut.js +++ b/src/serviceProviders/sourcehut.js @@ -25,7 +25,7 @@ limitations under the License. import * as E from '../enums.js' import { ServiceProvider } from '../serviceProvider.js' -export const reURI = /^https:\/\/git\.sr\.ht\/~([^~]*)\/(.*)\/?/ +export const reURI = /^https:\/\/git\.sr\.ht\/~([^~/]*)\/([^/]*)\/?$/ /** * @function @@ -88,5 +88,17 @@ export const tests = [ { uri: 'https://domain.org/alice/keyoxide_proof', shouldMatch: false + }, + { + uri: 'https://git.sr.ht/~alice/proof_repo/tree/master', + shouldMatch: false + }, + { + uri: 'https://git.sr.ht/~alice/proof_repo/blob/master/proof.md', + shouldMatch: false + }, + { + uri: 'https://git.sr.ht/~alice/proof_repo/blob/main/proof.md', + shouldMatch: false } ]