diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index a2ffd16..22703bf 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -2066,10 +2066,7 @@ function! s:Move(force, rename, destination) abort elseif a:rename let destination = fnamemodify(s:Relative(''), ':h') . '/' . a:destination else - let destination = s:shellslash(fnamemodify(s:sub(a:destination,'[%#]%(:\w)*','\=expand(submatch(0))'),':p')) - if destination[0:strlen(s:repo().tree())] ==# s:repo().tree('') - let destination = destination[strlen(s:repo().tree('')):-1] - endif + let destination = a:destination endif if isdirectory(s:buffer().spec()) setlocal noswapfile @@ -2099,9 +2096,7 @@ function! s:MoveComplete(A,L,P) abort if a:A =~# '^/' return s:repo().superglob(a:A) else - let matches = split(glob(a:A.'*'),"\n") - call map(matches,'v:val !~# "/$" && isdirectory(v:val) ? v:val."/" : v:val') - return matches + return map(s:repo().superglob('/' . a:A), 'strpart(v:val, 1)') endif endfunction diff --git a/doc/fugitive.txt b/doc/fugitive.txt index df9cb5f..dd816f3 100644 --- a/doc/fugitive.txt +++ b/doc/fugitive.txt @@ -199,11 +199,7 @@ that are part of Git repositories). *fugitive-:Gmove* :Gmove {destination} Wrapper around git-mv that renames the buffer - afterward. The destination is relative to the current - directory except when started with a /, in which case - it is relative to the work tree. (This is a holdover - from before |:Grename| and will be removed.) Add a ! - to pass -f. + afterward. Add a ! to pass -f. *fugitive-:Grename* :Grename {destination} Like |:Gmove| but operates relative to the parent