mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-15 14:53:51 -05:00
Don't assume buffer().commit() is a hash or stage
This commit is contained in:
@@ -388,10 +388,10 @@ function! s:buffer_expand(rev) dict abort
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:buffer_containing_commit() dict abort
|
function! s:buffer_containing_commit() dict abort
|
||||||
if self.commit() =~# '\x\{40\}'
|
if self.commit() =~# '^\d$'
|
||||||
return self.commit()
|
|
||||||
elseif self.commit() =~# '.'
|
|
||||||
return ':'
|
return ':'
|
||||||
|
elseif self.commit() =~# '.'
|
||||||
|
return self.commit()
|
||||||
else
|
else
|
||||||
return 'HEAD'
|
return 'HEAD'
|
||||||
endif
|
endif
|
||||||
@@ -888,7 +888,7 @@ function! s:Blame(bang,line1,line2,count) abort
|
|||||||
endif
|
endif
|
||||||
let git_dir = s:repo().dir()
|
let git_dir = s:repo().dir()
|
||||||
let cmd = ['--no-pager', 'blame', '--show-number']
|
let cmd = ['--no-pager', 'blame', '--show-number']
|
||||||
if strlen(s:buffer().commit()) == 40
|
if s:buffer().commit() =~# '\D\|..'
|
||||||
let cmd += [s:buffer().commit()]
|
let cmd += [s:buffer().commit()]
|
||||||
else
|
else
|
||||||
let cmd += ['--contents', '-']
|
let cmd += ['--contents', '-']
|
||||||
|
|||||||
Reference in New Issue
Block a user