mirror of
https://github.com/airblade/vim-gitgutter.git
synced 2025-11-08 19:43:47 -05:00
Remove unnecessary precondition.
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
let s:file = ''
|
let s:file = ''
|
||||||
|
|
||||||
function! utility#is_active()
|
function! utility#is_active()
|
||||||
return g:gitgutter_enabled && utility#exists_file() && utility#is_in_a_git_repo() && utility#is_tracked_by_git()
|
return g:gitgutter_enabled && utility#exists_file() && utility#is_tracked_by_git()
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! utility#current_file()
|
function! utility#current_file()
|
||||||
@@ -56,12 +56,6 @@ function! utility#command_in_directory_of_file(cmd)
|
|||||||
return substitute(utility#cmd_in_dir, "'", '"', 'g')
|
return substitute(utility#cmd_in_dir, "'", '"', 'g')
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! utility#is_in_a_git_repo()
|
|
||||||
let cmd = utility#escape('git rev-parse' . utility#discard_stdout_and_stderr())
|
|
||||||
call system(utility#command_in_directory_of_file(cmd))
|
|
||||||
return !v:shell_error
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! utility#is_tracked_by_git()
|
function! utility#is_tracked_by_git()
|
||||||
let cmd = utility#escape('git ls-files --error-unmatch' . utility#discard_stdout_and_stderr() . ' ' . shellescape(utility#file()))
|
let cmd = utility#escape('git ls-files --error-unmatch' . utility#discard_stdout_and_stderr() . ' ' . shellescape(utility#file()))
|
||||||
call system(utility#command_in_directory_of_file(cmd))
|
call system(utility#command_in_directory_of_file(cmd))
|
||||||
|
|||||||
Reference in New Issue
Block a user