Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fugitive upgrades #144

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions plugin/gitv.vim
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ fu! Gitv_OpenGitCommand(command, windowCmd, ...) "{{{
1,$ d _
else
let goBackTo = winnr()
let dir = fugitive#repo().dir()
let workingDir = fugitive#repo().tree()
let dir = FugitiveGitDir()
let workingDir = FugitiveFind(":/")
let cd = exists('*haslocaldir') && haslocaldir() ? 'lcd ' : 'cd '
let bufferDir = getcwd()
let tempSplitBelow = &splitbelow
Expand Down Expand Up @@ -241,7 +241,7 @@ fu! s:RunGitCommand(command, verbatim) "{{{
"switches to the buffer repository before running the command and switches back after.
if !a:verbatim
"switches to the buffer repository before running the command and switches back after.
let cmd = fugitive#repo().git_command() .' '. a:command
let cmd = FugitiveShellCommand() .' '. a:command
let [result, finalCmd] = s:RunCommandRelativeToGitRepo(cmd)
else
let result = system(a:command)
Expand All @@ -253,7 +253,7 @@ fu! s:RunCommandRelativeToGitRepo(command) abort "{{{
" Runs the command verbatim but first changing to the root git dir.
" Input commands should include a --git-dir argument to git (see
" fugitive#repo().git_command()).
let workingDir = fugitive#repo().tree()
let workingDir = FugitiveFind(":/")

let cd = exists('*haslocaldir') && haslocaldir() ? 'lcd ' : 'cd '
let bufferDir = getcwd()
Expand Down Expand Up @@ -282,7 +282,7 @@ fu! s:SanitizeReservedArgs(extraArgs) "{{{
let selectedFiles = []
let splitArgs = split(sanitizedArgs, ' ')
let index = len(splitArgs)
let root = fugitive#repo().tree().'/'
let root = FugitiveFind(":/")
while index
let index -= 1
let path = splitArgs[index]
Expand Down Expand Up @@ -521,7 +521,7 @@ fu! s:GetFileSlices(range, filePath, commitCount, extraArgs) "{{{
"NOTE: this could get massive for a large repo and large range
let range = a:range[0] . ',' . a:range[1]
let range = substitute(range, "'", "'\\\\''", 'g') "force unix style escaping even on windows
let git = fugitive#repo().git_command()
let git = FugitiveShellCommand()
let sliceCmd = "for hash in `".git." log " . a:extraArgs[0]
let sliceCmd .= " --no-color --pretty=format:%H -".a:commitCount." -- " . a:filePath . '`; '
let sliceCmd .= "do "
Expand Down Expand Up @@ -571,7 +571,7 @@ endfu "}}}
fu! s:GetFinalOutputForHashes(hashes) "{{{
if len(a:hashes) > 0
let extraArgs = s:ReapplyReservedArgs(['', ''])
let git = fugitive#repo().git_command()
let git = FugitiveShellCommand()
let cmd = 'for hash in ' . join(a:hashes, " ") . '; '
let cmd .= "do "
let cmd .= git.' log'
Expand Down Expand Up @@ -1514,7 +1514,7 @@ endf "}}} }}}
"Mapped Functions:"{{{
"Operations: "{{{
fu! s:GetCommitMsg() "{{{
return fugitive#repo().tree().'/.git/COMMIT_EDITMSG'
return FugitiveFind(":/").'/.git/COMMIT_EDITMSG'
endf "}}}
fu! s:OpenGitvCommit(geditForm, forceOpenFugitive) "{{{
let bindingsCmd = 'call s:MoveIntoPreviewAndExecute("call s:SetupMapping('."'".'toggleWindow'."'".', s:defaultMappings)", 0)'
Expand Down Expand Up @@ -1571,7 +1571,7 @@ endf
fu! s:OpenWorkingCopy(geditForm)
let fp = s:GetRelativeFilePath()
let form = a:geditForm[1:] "strip off the leading 'G'
let cmd = form . " " . fugitive#repo().tree() . "/" . fp
let cmd = form . " " . FugitiveFind(":/") . "/" . fp
let cmd = 'call s:RecordBufferExecAndWipe("'.cmd.'", '.(form=='edit').')'
call s:MoveIntoPreviewAndExecute(cmd, 1)
endfu
Expand Down Expand Up @@ -1674,7 +1674,7 @@ fu! s:RebaseSetInstruction(instruction) range "{{{
endif
endf "}}}
fu! s:RebaseHasStarted() "{{{
return !empty(glob(fugitive#repo().tree().'/.git/rebase-merge'))
return !empty(glob(FugitiveFind(":/").'/.git/rebase-merge'))
endf "}}}
fu! s:RebaseGetRefs(line) "{{{
let sha = gitv#util#line#sha(a:line)
Expand Down Expand Up @@ -2002,13 +2002,13 @@ fu! s:RebaseContinueCleanup() "{{{
endif
endf "}}}
fu! s:GetRebaseHeadname() "{{{
return fugitive#repo().tree().'/.git/rebase-merge/head-name'
return FugitiveFind(":/").'/.git/rebase-merge/head-name'
endf "}}}
fu! s:GetRebaseDone() "{{{
return fugitive#repo().tree().'/.git/rebase-merge/done'
return FugitiveFind(":/").'/.git/rebase-merge/done'
endf "}}}
fu! s:GetRebaseTodo() "{{{
return fugitive#repo().tree().'/.git/rebase-merge/git-rebase-todo'
return FugitiveFind(":/").'/.git/rebase-merge/git-rebase-todo'
endf "}}}
fu! s:RebaseViewInstructions() "{{{
exec 'edit' s:workingFile
Expand Down Expand Up @@ -2055,7 +2055,7 @@ fu! s:RebaseEdit() "{{{
endf "}}} }}}
"Bisect: "{{{
fu! s:IsBisectingFiles(filePaths) "{{{
let path = fugitive#repo().tree().'/.git/BISECT_NAMES'
let path = FugitiveFind(":/").'/.git/BISECT_NAMES'
if empty(glob(path))
return 0
endif
Expand Down