From f2738ccb35cf2b949f95def74b8ea59ba1b676d0 Mon Sep 17 00:00:00 2001 From: Nanashi Date: Mon, 20 Jun 2022 17:08:30 +0900 Subject: [PATCH] Fix: Don't remove auth if submodules are off --- src/git-auth-helper.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/git-auth-helper.ts b/src/git-auth-helper.ts index 8a1c7c3..888fde1 100644 --- a/src/git-auth-helper.ts +++ b/src/git-auth-helper.ts @@ -363,10 +363,12 @@ class GitAuthHelper { } } - const pattern = regexpHelper.escape(configKey) - await this.git.submoduleForeach( - `git config --local --name-only --get-regexp '${pattern}' && git config --local --unset-all '${configKey}' || :`, - true + if (this.settings.submodules) { + const pattern = regexpHelper.escape(configKey) + await this.git.submoduleForeach( + `git config --local --name-only --get-regexp '${pattern}' && git config --local --unset-all '${configKey}' || :`, + true + ) ) } }