mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-12 05:13:53 -05:00
Include --no-literal-pathspecs in FugitiveResult().flags
This allows for passing the result to helpers like fugitive#ShellCommand() without its own path munging behaviors kicking in.
This commit is contained in:
@@ -3213,6 +3213,7 @@ function! fugitive#Command(line1, line2, range, bang, mods, arg) abort
|
|||||||
let [args, after] = s:SplitExpandChain(a:arg, s:Tree(dir))
|
let [args, after] = s:SplitExpandChain(a:arg, s:Tree(dir))
|
||||||
let flags = []
|
let flags = []
|
||||||
let pager = -1
|
let pager = -1
|
||||||
|
let explicit_pathspec_option = 0
|
||||||
while len(args)
|
while len(args)
|
||||||
if args[0] ==# '-c' && len(args) > 1
|
if args[0] ==# '-c' && len(args) > 1
|
||||||
call extend(flags, remove(args, 0, 1))
|
call extend(flags, remove(args, 0, 1))
|
||||||
@@ -3222,7 +3223,10 @@ function! fugitive#Command(line1, line2, range, bang, mods, arg) abort
|
|||||||
elseif args[0] =~# '^-P$\|^--no-pager$'
|
elseif args[0] =~# '^-P$\|^--no-pager$'
|
||||||
let pager = 0
|
let pager = 0
|
||||||
call remove(args, 0)
|
call remove(args, 0)
|
||||||
elseif args[0] =~# '^--\%([[:lower:]-]\+-pathspecs\|no-optional-locks\)$'
|
elseif args[0] =~# '^--\%([[:lower:]-]\+-pathspecs\)$'
|
||||||
|
let explicit_pathspec_option = 1
|
||||||
|
call add(flags, remove(args, 0))
|
||||||
|
elseif args[0] =~# '^\%(--no-optional-locks\)$'
|
||||||
call add(flags, remove(args, 0))
|
call add(flags, remove(args, 0))
|
||||||
elseif args[0] =~# '^-C$\|^--\%(exec-path=\|git-dir=\|work-tree=\|bare$\)'
|
elseif args[0] =~# '^-C$\|^--\%(exec-path=\|git-dir=\|work-tree=\|bare$\)'
|
||||||
return 'echoerr ' . string('fugitive: ' . args[0] . ' is not supported')
|
return 'echoerr ' . string('fugitive: ' . args[0] . ' is not supported')
|
||||||
@@ -3230,6 +3234,9 @@ function! fugitive#Command(line1, line2, range, bang, mods, arg) abort
|
|||||||
break
|
break
|
||||||
endif
|
endif
|
||||||
endwhile
|
endwhile
|
||||||
|
if !explicit_pathspec_option
|
||||||
|
call insert(flags, '--no-literal-pathspecs')
|
||||||
|
endif
|
||||||
if pager is# 0
|
if pager is# 0
|
||||||
call add(flags, '--no-pager')
|
call add(flags, '--no-pager')
|
||||||
endif
|
endif
|
||||||
|
|||||||
Reference in New Issue
Block a user