Remove unused argument
Temporarily changing directories is cheap.
This commit is contained in:
parent
4aca2ee9c5
commit
79d867a7a6
@ -27,67 +27,67 @@ endfunction
|
|||||||
|
|
||||||
" Function: #get_diff_git {{{1
|
" Function: #get_diff_git {{{1
|
||||||
function! sy#repo#get_diff_git() abort
|
function! sy#repo#get_diff_git() abort
|
||||||
let diff = s:run(g:signify_vcs_cmds.git, b:sy_info.file, 1)
|
let diff = s:run(g:signify_vcs_cmds.git, b:sy_info.file)
|
||||||
return v:shell_error ? [0, ''] : [1, diff]
|
return v:shell_error ? [0, ''] : [1, diff]
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" Function: #get_diff_hg {{{1
|
" Function: #get_diff_hg {{{1
|
||||||
function! sy#repo#get_diff_hg() abort
|
function! sy#repo#get_diff_hg() abort
|
||||||
let diff = s:run(g:signify_vcs_cmds.hg, b:sy_info.path, 1)
|
let diff = s:run(g:signify_vcs_cmds.hg, b:sy_info.path)
|
||||||
return v:shell_error ? [0, ''] : [1, diff]
|
return v:shell_error ? [0, ''] : [1, diff]
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" Function: #get_diff_svn {{{1
|
" Function: #get_diff_svn {{{1
|
||||||
function! sy#repo#get_diff_svn() abort
|
function! sy#repo#get_diff_svn() abort
|
||||||
let diff = s:run(g:signify_vcs_cmds.svn, b:sy_info.path, 0)
|
let diff = s:run(g:signify_vcs_cmds.svn, b:sy_info.path)
|
||||||
return v:shell_error ? [0, ''] : [1, diff]
|
return v:shell_error ? [0, ''] : [1, diff]
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" Function: #get_diff_bzr {{{1
|
" Function: #get_diff_bzr {{{1
|
||||||
function! sy#repo#get_diff_bzr() abort
|
function! sy#repo#get_diff_bzr() abort
|
||||||
let diff = s:run(g:signify_vcs_cmds.bzr, b:sy_info.path, 0)
|
let diff = s:run(g:signify_vcs_cmds.bzr, b:sy_info.path)
|
||||||
return (v:shell_error =~ '[012]') ? [1, diff] : [0, '']
|
return (v:shell_error =~ '[012]') ? [1, diff] : [0, '']
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" Function: #get_diff_darcs {{{1
|
" Function: #get_diff_darcs {{{1
|
||||||
function! sy#repo#get_diff_darcs() abort
|
function! sy#repo#get_diff_darcs() abort
|
||||||
let diff = s:run(g:signify_vcs_cmds.darcs, b:sy_info.path, 1)
|
let diff = s:run(g:signify_vcs_cmds.darcs, b:sy_info.path)
|
||||||
return v:shell_error ? [0, ''] : [1, diff]
|
return v:shell_error ? [0, ''] : [1, diff]
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" Function: #get_diff_fossil {{{1
|
" Function: #get_diff_fossil {{{1
|
||||||
function! sy#repo#get_diff_fossil() abort
|
function! sy#repo#get_diff_fossil() abort
|
||||||
let diff = s:run(g:signify_vcs_cmds.fossil, b:sy_info.path, 1)
|
let diff = s:run(g:signify_vcs_cmds.fossil, b:sy_info.path)
|
||||||
return v:shell_error ? [0, ''] : [1, diff]
|
return v:shell_error ? [0, ''] : [1, diff]
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" Function: #get_diff_cvs {{{1
|
" Function: #get_diff_cvs {{{1
|
||||||
function! sy#repo#get_diff_cvs() abort
|
function! sy#repo#get_diff_cvs() abort
|
||||||
let diff = s:run(g:signify_vcs_cmds.cvs, b:sy_info.file, 1)
|
let diff = s:run(g:signify_vcs_cmds.cvs, b:sy_info.file)
|
||||||
return ((v:shell_error == 1) && (diff =~ '+++')) ? [1, diff] : [0, '']
|
return ((v:shell_error == 1) && (diff =~ '+++')) ? [1, diff] : [0, '']
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" Function: #get_diff_rcs {{{1
|
" Function: #get_diff_rcs {{{1
|
||||||
function! sy#repo#get_diff_rcs() abort
|
function! sy#repo#get_diff_rcs() abort
|
||||||
let diff = s:run(g:signify_vcs_cmds.rcs, b:sy_info.path, 0)
|
let diff = s:run(g:signify_vcs_cmds.rcs, b:sy_info.path)
|
||||||
return v:shell_error ? [0, ''] : [1, diff]
|
return v:shell_error ? [0, ''] : [1, diff]
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" Function: #get_diff_accurev {{{1
|
" Function: #get_diff_accurev {{{1
|
||||||
function! sy#repo#get_diff_accurev() abort
|
function! sy#repo#get_diff_accurev() abort
|
||||||
let diff = s:run(g:signify_vcs_cmds.accurev, b:sy_info.file, 1)
|
let diff = s:run(g:signify_vcs_cmds.accurev, b:sy_info.file)
|
||||||
return (v:shell_error >= 2) ? [0, ''] : [1, diff]
|
return (v:shell_error >= 2) ? [0, ''] : [1, diff]
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" Function: #get_diff_perforce {{{1
|
" Function: #get_diff_perforce {{{1
|
||||||
function! sy#repo#get_diff_perforce() abort
|
function! sy#repo#get_diff_perforce() abort
|
||||||
let diff = s:run(g:signify_vcs_cmds.perforce, b:sy_info.path, 0)
|
let diff = s:run(g:signify_vcs_cmds.perforce, b:sy_info.path)
|
||||||
return v:shell_error ? [0, ''] : [1, diff]
|
return v:shell_error ? [0, ''] : [1, diff]
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" Function: #get_diff_tfs {{{1
|
" Function: #get_diff_tfs {{{1
|
||||||
function! sy#repo#get_diff_tfs() abort
|
function! sy#repo#get_diff_tfs() abort
|
||||||
let diff = s:run(g:signify_vcs_cmds.tfs, b:sy_info.file, 0)
|
let diff = s:run(g:signify_vcs_cmds.tfs, b:sy_info.file)
|
||||||
return v:shell_error ? [0, ''] : [1, s:strip_context(diff)]
|
return v:shell_error ? [0, ''] : [1, s:strip_context(diff)]
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
@ -108,17 +108,17 @@ function! sy#repo#debug_detection()
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
let vcs_args = {
|
let vcs_args = {
|
||||||
\ 'git': [g:signify_vcs_cmds.git, b:sy_info.file, 1],
|
\ 'git': [g:signify_vcs_cmds.git, b:sy_info.file],
|
||||||
\ 'hg': [g:signify_vcs_cmds.hg, b:sy_info.path, 1],
|
\ 'hg': [g:signify_vcs_cmds.hg, b:sy_info.path],
|
||||||
\ 'svn': [g:signify_vcs_cmds.svn, b:sy_info.path, 0],
|
\ 'svn': [g:signify_vcs_cmds.svn, b:sy_info.path],
|
||||||
\ 'darcs': [g:signify_vcs_cmds.darcs, b:sy_info.path, 1],
|
\ 'darcs': [g:signify_vcs_cmds.darcs, b:sy_info.path],
|
||||||
\ 'bzr': [g:signify_vcs_cmds.bzr, b:sy_info.path, 0],
|
\ 'bzr': [g:signify_vcs_cmds.bzr, b:sy_info.path],
|
||||||
\ 'fossil': [g:signify_vcs_cmds.fossil, b:sy_info.path, 1],
|
\ 'fossil': [g:signify_vcs_cmds.fossil, b:sy_info.path],
|
||||||
\ 'cvs': [g:signify_vcs_cmds.cvs, b:sy_info.file, 1],
|
\ 'cvs': [g:signify_vcs_cmds.cvs, b:sy_info.file],
|
||||||
\ 'rcs': [g:signify_vcs_cmds.rcs, b:sy_info.path, 0],
|
\ 'rcs': [g:signify_vcs_cmds.rcs, b:sy_info.path],
|
||||||
\ 'accurev': [g:signify_vcs_cmds.accurev, b:sy_info.file, 1],
|
\ 'accurev': [g:signify_vcs_cmds.accurev, b:sy_info.file],
|
||||||
\ 'perforce': [g:signify_vcs_cmds.perforce, b:sy_info.path, 0],
|
\ 'perforce': [g:signify_vcs_cmds.perforce, b:sy_info.path],
|
||||||
\ 'tfs': [g:signify_vcs_cmds.tfs, b:sy_info.file, 0],
|
\ 'tfs': [g:signify_vcs_cmds.tfs, b:sy_info.file],
|
||||||
\ }
|
\ }
|
||||||
|
|
||||||
for vcs in s:vcs_list
|
for vcs in s:vcs_list
|
||||||
@ -150,7 +150,7 @@ function! s:expand_cmd(cmd, path) abort
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" Function: s:run {{{1
|
" Function: s:run {{{1
|
||||||
function! s:run(cmd, path, do_switch_dir)
|
function! s:run(cmd, path)
|
||||||
execute b:sy_info.chdir fnameescape(b:sy_info.dir)
|
execute b:sy_info.chdir fnameescape(b:sy_info.dir)
|
||||||
try
|
try
|
||||||
let ret = system(s:expand_cmd(a:cmd, a:path))
|
let ret = system(s:expand_cmd(a:cmd, a:path))
|
||||||
|
Loading…
Reference in New Issue
Block a user