Browse Source

escape values passed to --unset (#2530)

Aiqiao Yan 1 tháng trước cách đây
mục cha
commit
28802689a1
2 tập tin đã thay đổi với 2 bổ sung2 xóa
  1. 1 1
      dist/index.js
  2. 1 1
      src/git-command-manager.ts

+ 1 - 1
dist/index.js

@@ -35913,7 +35913,7 @@ class GitCommandManager {
         else {
             args.push(globalConfig ? '--global' : '--local');
         }
-        args.push('--unset', configKey, configValue);
+        args.push('--unset', configKey, regexp_helper_escape(configValue));
         const output = await this.execGit(args, true);
         return output.exitCode === 0;
     }

+ 1 - 1
src/git-command-manager.ts

@@ -510,7 +510,7 @@ class GitCommandManager {
     } else {
       args.push(globalConfig ? '--global' : '--local')
     }
-    args.push('--unset', configKey, configValue)
+    args.push('--unset', configKey, regexpHelper.escape(configValue))
 
     const output = await this.execGit(args, true)
     return output.exitCode === 0