mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-08 19:43:46 -05:00
Compare commits
1 Commits
buffer_pat
...
http_githu
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ff32149a59 |
@@ -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.
|
||||
|
||||
@@ -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,':','/')
|
||||
|
||||
Reference in New Issue
Block a user