From bcb1336bd008efde95daae0599a656ca67c2d94f Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Fri, 6 Apr 2018 01:35:26 +0200 Subject: 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. --- bundle/github-url/autoload/github_url.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bundle/github-url/autoload/github_url.vim') 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 ``, 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 = '' -- cgit v1.2.3