From 23138572f40877d01079246244e83babd4837af4 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Tue, 9 Jul 2019 13:14:23 -0400 Subject: [PATCH] Fix :[range]Glog Closes https://github.com/tpope/vim-fugitive/issues/1280 --- autoload/fugitive.vim | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index 9a3fe8c..389b4d9 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -3421,16 +3421,16 @@ function! s:Log(type, bang, line1, line2, args) abort else let paths = [] endif - let path = fugitive#Path(@%, '', dir) - if path =~# '^\.git\%(/\|$\)' || a:line2 < 0 + let path = fugitive#Path(@%, '/', dir) + if path =~# '^/\.git\%(/\|$\)\|^$' || a:line2 < 0 let path = '' elseif a:line2 > 0 - call add(args, '-L' . a:line1 . ',' . a:line2 . ':' . path) + call add(args, '-L' . a:line1 . ',' . a:line2 . ':' . path[1:-1]) else if empty(paths) call add(paths, '--') endif - call add(paths, path) + call add(paths, path ==# '/' ? '.' : path[1:-1]) endif if len(path) && empty(filter(copy(args), 'v:val =~# "^[^-]"')) let owner = s:Owner(@%, dir)