aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2018-04-06 01:35:26 +0200
committerTeddy Wing2018-04-06 01:35:26 +0200
commitbcb1336bd008efde95daae0599a656ca67c2d94f (patch)
treec45963c66abc7b3325b98935980f5cdc34c5af35
parent2e3d5630df8ce9ffacc9f03c5f7ec5327f0b9c59 (diff)
downloaddotvim-bcb1336bd008efde95daae0599a656ca67c2d94f.tar.bz2
github-url: Add `--no-patch` to `git show` command
If there's a diff in the index, that will get included in the output of this command, meaning that just after the SHA, there will be a multi-line diff string that completely messes up the constructed URL. Use the `--no-patch` flag to suppress diff output.
-rw-r--r--bundle/github-url/autoload/github_url.vim2
1 files changed, 1 insertions, 1 deletions
diff --git a/bundle/github-url/autoload/github_url.vim b/bundle/github-url/autoload/github_url.vim
index 11110a8..c83c6f6 100644
--- a/bundle/github-url/autoload/github_url.vim
+++ b/bundle/github-url/autoload/github_url.vim
@@ -14,7 +14,7 @@ endfunction
" argument comes from a `:command`'s `<count>`, and tells the function whether
" a range was given.
function! s:FileURL(include_lines, start_line, end_line)
- let current_sha = system('git show --format="format:%H"')
+ let current_sha = system('git show --no-patch --format="format:%H"')
let current_sha = substitute(current_sha, '\n$', '', '')
let current_filename = expand('%')
let lines = ''