mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-08 11:33:47 -05:00
@@ -1631,7 +1631,7 @@ function! s:Owner(path, ...) abort
|
|||||||
endif
|
endif
|
||||||
let actualdir = fugitive#Find('.git/', dir)
|
let actualdir = fugitive#Find('.git/', dir)
|
||||||
let [pdir, commit, file] = s:DirCommitFile(a:path)
|
let [pdir, commit, file] = s:DirCommitFile(a:path)
|
||||||
if s:cpath(dir, pdir)
|
if s:cpath(s:GitDir(dir), s:GitDir(pdir))
|
||||||
if commit =~# '^\x\{40,\}$'
|
if commit =~# '^\x\{40,\}$'
|
||||||
return commit
|
return commit
|
||||||
elseif commit ==# '2'
|
elseif commit ==# '2'
|
||||||
@@ -1667,7 +1667,7 @@ function! fugitive#Real(url) abort
|
|||||||
let [dir, commit, file] = s:DirCommitFile(a:url)
|
let [dir, commit, file] = s:DirCommitFile(a:url)
|
||||||
if len(dir)
|
if len(dir)
|
||||||
let tree = s:Tree(dir)
|
let tree = s:Tree(dir)
|
||||||
return FugitiveVimPath((len(tree) ? tree : dir) . file)
|
return FugitiveVimPath((len(tree) ? tree : s:GitDir(dir)) . file)
|
||||||
endif
|
endif
|
||||||
let pre = substitute(matchstr(a:url, '^\a\a\+\ze:'), '^.', '\u&', '')
|
let pre = substitute(matchstr(a:url, '^\a\a\+\ze:'), '^.', '\u&', '')
|
||||||
if len(pre) && pre !=? 'fugitive' && exists('*' . pre . 'Real')
|
if len(pre) && pre !=? 'fugitive' && exists('*' . pre . 'Real')
|
||||||
@@ -1712,7 +1712,7 @@ function! fugitive#Path(url, ...) abort
|
|||||||
let url = url[0:-2]
|
let url = url[0:-2]
|
||||||
endif
|
endif
|
||||||
let [argdir, commit, file] = s:DirCommitFile(a:url)
|
let [argdir, commit, file] = s:DirCommitFile(a:url)
|
||||||
if len(argdir) && s:cpath(argdir) !=# s:cpath(dir)
|
if !empty(argdir) && !s:cpath(s:GitDir(argdir), dir)
|
||||||
let file = ''
|
let file = ''
|
||||||
elseif len(dir) && s:cpath(url[0 : len(dir)]) ==# s:cpath(dir . '/')
|
elseif len(dir) && s:cpath(url[0 : len(dir)]) ==# s:cpath(dir . '/')
|
||||||
let file = '/.git'.url[strlen(dir) : -1]
|
let file = '/.git'.url[strlen(dir) : -1]
|
||||||
@@ -1724,7 +1724,7 @@ function! fugitive#Path(url, ...) abort
|
|||||||
if empty(file) && a:1 =~# '^$\|^[.:]/$'
|
if empty(file) && a:1 =~# '^$\|^[.:]/$'
|
||||||
return FugitiveGitPath(fugitive#Real(a:url))
|
return FugitiveGitPath(fugitive#Real(a:url))
|
||||||
endif
|
endif
|
||||||
return substitute(file, '^/', a:1, '')
|
return substitute(file, '^/', '\=a:1', '')
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:Relative(...) abort
|
function! s:Relative(...) abort
|
||||||
@@ -2280,7 +2280,8 @@ let s:globsubs = {
|
|||||||
\ '*': '[^/]*',
|
\ '*': '[^/]*',
|
||||||
\ '?': '[^/]'}
|
\ '?': '[^/]'}
|
||||||
function! fugitive#glob(url, ...) abort
|
function! fugitive#glob(url, ...) abort
|
||||||
let [dirglob, commit, glob] = s:DirCommitFile(a:url)
|
let [dir, commit, glob] = s:DirCommitFile(a:url)
|
||||||
|
let dirglob = s:GitDir(dir)
|
||||||
let append = matchstr(glob, '/*$')
|
let append = matchstr(glob, '/*$')
|
||||||
let glob = substitute(glob, '/*$', '', '')
|
let glob = substitute(glob, '/*$', '', '')
|
||||||
let pattern = '^' . substitute(glob, '/\=\*\*/\=\|/\=\*\|[.?\$]\|^^', '\=get(s:globsubs, submatch(0), "\\" . submatch(0))', 'g')[1:-1] . '$'
|
let pattern = '^' . substitute(glob, '/\=\*\*/\=\|/\=\*\|[.?\$]\|^^', '\=get(s:globsubs, submatch(0), "\\" . submatch(0))', 'g')[1:-1] . '$'
|
||||||
@@ -5015,7 +5016,7 @@ function! s:StageIgnore(lnum1, lnum2, count) abort
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:DoToggleHeadHeader(value) abort
|
function! s:DoToggleHeadHeader(value) abort
|
||||||
exe 'edit' s:fnameescape(s:Dir())
|
exe 'edit' fnameescape(fugitive#Find('.git/'))
|
||||||
call search('\C^index$', 'wc')
|
call search('\C^index$', 'wc')
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
@@ -6850,7 +6851,7 @@ function! s:BlameSubcommand(line1, count, range, bang, mods, options) abort
|
|||||||
else
|
else
|
||||||
call fugitive#Autowrite()
|
call fugitive#Autowrite()
|
||||||
endif
|
endif
|
||||||
let basecmd = [{'git': a:options.git, 'git_dir': dir}] + ['--literal-pathspecs'] + cmd + ['--'] + (len(files) ? files : [file])
|
let basecmd = [{'git': a:options.git}, dir, '--literal-pathspecs'] + cmd + ['--'] + (len(files) ? files : [file])
|
||||||
let [err, exec_error] = s:StdoutToFile(temp, basecmd)
|
let [err, exec_error] = s:StdoutToFile(temp, basecmd)
|
||||||
if exists('delete_in')
|
if exists('delete_in')
|
||||||
call delete(tempname . '.in')
|
call delete(tempname . '.in')
|
||||||
@@ -6881,8 +6882,8 @@ function! s:BlameSubcommand(line1, count, range, bang, mods, options) abort
|
|||||||
\ 'git': a:options.git,
|
\ 'git': a:options.git,
|
||||||
\ 'flags': a:options.flags,
|
\ 'flags': a:options.flags,
|
||||||
\ 'args': [a:options.subcommand] + a:options.subcommand_args,
|
\ 'args': [a:options.subcommand] + a:options.subcommand_args,
|
||||||
\ 'git_dir': dir,
|
\ 'git_dir': s:GitDir(a:options),
|
||||||
\ 'cwd': s:UserCommandCwd(dir),
|
\ 'cwd': s:UserCommandCwd(a:options),
|
||||||
\ 'filetype': (raw ? 'git' : 'fugitiveblame'),
|
\ 'filetype': (raw ? 'git' : 'fugitiveblame'),
|
||||||
\ 'blame_options': a:options,
|
\ 'blame_options': a:options,
|
||||||
\ 'blame_flags': flags,
|
\ 'blame_flags': flags,
|
||||||
|
|||||||
Reference in New Issue
Block a user