From 55d3c0468dc6ef76267e5bc9eaab548f0c5e7283 Mon Sep 17 00:00:00 2001 From: Rhys Arkins Date: Wed, 17 Nov 2021 22:27:12 +0100 Subject: [PATCH] fix(presets): allow spaces in repo names (#12726) --- lib/config/presets/index.spec.ts | 9 +++++++++ lib/config/presets/index.ts | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/config/presets/index.spec.ts b/lib/config/presets/index.spec.ts index 49e052eb0f7a59..71563487ef8a29 100644 --- a/lib/config/presets/index.spec.ts +++ b/lib/config/presets/index.spec.ts @@ -407,6 +407,15 @@ describe('config/presets/index', () => { presetSource: 'local', }); }); + it('parses local with spaces', () => { + expect(presets.parsePreset('local>A2B CD/A2B_Renovate')).toEqual({ + packageName: 'A2B CD/A2B_Renovate', + params: undefined, + presetName: 'default', + presetPath: undefined, + presetSource: 'local', + }); + }); it('parses local with subdirectory', () => { expect( presets.parsePreset('local>some-group/some-repo//some-dir/some-file') diff --git a/lib/config/presets/index.ts b/lib/config/presets/index.ts index 7ede0fc37ae336..16a39c1ac17941 100644 --- a/lib/config/presets/index.ts +++ b/lib/config/presets/index.ts @@ -40,7 +40,7 @@ const nonScopedPresetWithSubdirRegex = regEx( /^(?~?[\w\-./]+?)\/\/(?:(?[\w\-./]+)\/)?(?[\w\-.]+)(?:#(?[\w\-.]+?))?$/ ); const gitPresetRegex = regEx( - /^(?[\w\-./]+)(?::(?[\w-./]+\/))?(?::?(?[\w\-.+]+))?(?:#(?[\w\-.]+?))?$/ + /^(?[\w\-. /]+)(?::(?[\w-./]+\/))?(?::?(?[\w\-.+]+))?(?:#(?[\w\-.]+?))?$/ ); export function replaceArgs(