Fix instaweb current buffer assumption

This commit is contained in:
Tim Pope
2015-12-01 18:41:29 -05:00
parent a9a22e0e4e
commit cac2c8ef8e

View File

@@ -2375,10 +2375,8 @@ function! s:instaweb_url(opts) abort
endif endif
let url .= ';h=' . a:opts.repo.rev_parse(a:opts.commit . (a:opts.path == '' ? '' : ':' . a:opts.path)) let url .= ';h=' . a:opts.repo.rev_parse(a:opts.commit . (a:opts.path == '' ? '' : ':' . a:opts.path))
else else
if a:opts.type ==# 'blob' if a:opts.type ==# 'blob' && empty(a:opts.commit)
let tmp = tempname() let url .= ';h='.a:opts.repo.git_chomp('hash-object', '-w', a:opts.path)
silent execute 'write !'.a:opts.repo.git_command('hash-object','-w','--stdin').' > '.tmp
let url .= ';h=' . readfile(tmp)[0]
else else
try try
let url .= ';h=' . a:opts.repo.rev_parse((a:opts.commit == '' ? 'HEAD' : ':' . a:opts.commit) . ':' . a:opts.path) let url .= ';h=' . a:opts.repo.rev_parse((a:opts.commit == '' ? 'HEAD' : ':' . a:opts.commit) . ':' . a:opts.path)