1 Commits

Author SHA1 Message Date
Tim Pope
ff32149a59 Attempt to allow :Gbrowse on HTTP GitHub FI 2012-11-18 21:35:45 -05:00
2 changed files with 5 additions and 5 deletions

View File

@@ -122,7 +122,7 @@ that are part of Git repositories).
:{range}Gread! [args] |:read| the output of a Git command after {range}.
*fugitive-:Gw* *fugitive-:Gwrite*
*fugitive-:Gwrite*
:Gwrite Write to the current file's path and stage the results.
When run in a work tree file, it is effectively git
add. Elsewhere, it is effectively git-checkout. A
@@ -203,7 +203,7 @@ that are part of Git repositories).
To use with GitHub FI, point g:fugitive_github_domains
at a list of domains:
>
let g:fugitive_github_domains = ['https://example.com']
let g:fugitive_github_domains = ['git.example.com']
~
:[range]Gbrowse! Like :Gbrowse, but put the URL on the clipboard rather
than opening it.

View File

@@ -506,9 +506,9 @@ function! s:buffer_path(...) dict abort
let rev = matchstr(self.spec(),'^fugitive://.\{-\}//\zs.*')
if rev != ''
let rev = s:sub(rev,'\w*','')
elseif self.spec()[0 : len(self.repo().dir())] ==# self.repo().dir() . '/'
elseif self.repo().bare()
let rev = '/.git'.self.spec()[strlen(self.repo().dir()) : -1]
elseif !self.repo().bare() && self.spec()[0 : len(self.repo().tree())] ==# self.repo().tree() . '/'
else
let rev = self.spec()[strlen(self.repo().tree()) : -1]
endif
return s:sub(s:sub(rev,'.\zs/$',''),'^/',a:0 ? a:1 : '')
@@ -1878,7 +1878,7 @@ function! s:github_url(repo,url,rev,commit,path,type,line1,line2) abort
if repo ==# ''
return ''
endif
if index(domains, 'http://' . matchstr(repo, '^[^:/]*')) >= 0
if index(g:fugitive_github_domains, 'http://' . matchstr(repo, '^[^:/]*')) >= 0
let root = 'http://' . s:sub(repo,':','/')
else
let root = 'https://' . s:sub(repo,':','/')