From 3a5d8c8770f6fc985f24b277583e80b0028d5727 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Thu, 5 Aug 2021 17:24:15 -0400 Subject: [PATCH] Tighten check for PowerShell to match Vim's behavior Vim only checks for the lowercase "powershell", so we should do the same. --- autoload/fugitive.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index fd234b8..528c6d0 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -474,7 +474,7 @@ function! s:BuildEnvPrefix(env) abort let env = items(a:env) if empty(env) return '' - elseif &shell =~? '\%(powershell\|pwsh\)\%(\.exe\)\=$' + elseif &shell =~# '\%(powershell\|pwsh\)\%(\.exe\)\=$' return join(map(env, '"$Env:" . v:val[0] . " = ''" . substitute(v:val[1], "''", "''''", "g") . "''; "'), '') elseif s:winshell() return join(map(env, '"set " . substitute(join(v:val, "="), "[&|<>^]", "^^^&", "g") . "& "'), '') @@ -1645,7 +1645,7 @@ function! s:TempCmd(out, cmd) abort try let cmd = (type(a:cmd) == type([]) ? fugitive#Prepare(a:cmd) : a:cmd) let redir = ' > ' . a:out - let pwsh = &shell =~? '\%(powershell\|pwsh\)\%(\.exe\)\=$' + let pwsh = &shell =~# '\%(powershell\|pwsh\)\%(\.exe\)\=$' if pwsh && has('patch-8.2.3079') return s:SystemError(&shell . ' ' . &shellcmdflag . ' ' . s:shellesc(cmd . redir)) elseif (s:winshell() || pwsh) && !has('nvim')