From 3ebe8f7339093206644417ac15c863c28570660f Mon Sep 17 00:00:00 2001
From: Giridharan Manivannan <giridar123@gmail.com>
Date: Wed, 31 Mar 2021 21:05:53 +0530
Subject: [PATCH] [test] submodule call.

---
 src/git-auth-helper.ts | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/src/git-auth-helper.ts b/src/git-auth-helper.ts
index 291d83b..7d620fc 100644
--- a/src/git-auth-helper.ts
+++ b/src/git-auth-helper.ts
@@ -341,10 +341,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
+      )
+    }
   }
 }