diff --git a/lib/manager/pre-commit/__fixtures__/.pre-commit-config.yaml b/lib/manager/pre-commit/__fixtures__/.pre-commit-config.yaml index 911a675437788b..e48a6108aafe1e 100644 --- a/lib/manager/pre-commit/__fixtures__/.pre-commit-config.yaml +++ b/lib/manager/pre-commit/__fixtures__/.pre-commit-config.yaml @@ -1,7 +1,7 @@ # See https://pre-commit.com for more information # See https://pre-commit.com/hooks.html for more hooks repos: -- repo: https://github.com/pre-commit/pre-commit-hooks +- repo: https://github.com/pre-commit/pre-commit-hooks.git rev: v2.4.0 hooks: - id: trailing-whitespace diff --git a/lib/manager/pre-commit/extract.ts b/lib/manager/pre-commit/extract.ts index 4c316ef9a672db..2708d1ddd86e2f 100644 --- a/lib/manager/pre-commit/extract.ts +++ b/lib/manager/pre-commit/extract.ts @@ -98,7 +98,8 @@ function extractDependency( for (const urlMatcher of urlMatchers) { const match = urlMatcher.exec(repository); if (match) { - const { hostname, depName } = match.groups; + const hostname = match.groups.hostname; + const depName = match.groups.depName.replace(/\.git$/i, ''); const sourceDef = determineDatasource(repository, hostname); return { ...sourceDef,