Skip to content

Commit

Permalink
Resolves an issue whereby non-strings can be passed into the config s…
Browse files Browse the repository at this point in the history
…witch detector.

Closes #866
  • Loading branch information
steveukx committed Nov 30, 2022
1 parent e1d66b6 commit cd0c9f4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/unlucky-dragons-fry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'simple-git': patch
---

Resolves an issue whereby non-strings can be passed into the config switch detector.
4 changes: 2 additions & 2 deletions simple-git/src/lib/plugins/block-unsafe-operations-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import type { SimpleGitPlugin } from './simple-git-plugin';
import { GitPluginError } from '../errors/git-plugin-error';
import type { SimpleGitPluginConfig } from '../types';

function isConfigSwitch(arg: string) {
return arg.trim().toLowerCase() === '-c';
function isConfigSwitch(arg: string | unknown) {
return typeof arg === 'string' && arg.trim().toLowerCase() === '-c';
}

function preventProtocolOverride(arg: string, next: string) {
Expand Down

0 comments on commit cd0c9f4

Please sign in to comment.