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

feat: use short commit instead of full sha #65

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions plugin/vim-gh-line.vim
Original file line number Diff line number Diff line change
Expand Up @@ -249,9 +249,9 @@ endfunc

func! s:Commit(cdDir)
if exists('g:gh_use_canonical') && g:gh_use_canonical > 0
return system(a:cdDir . 'git rev-parse HEAD')
return system(a:cdDir . 'git rev-parse --short HEAD')
else
return system(a:cdDir . 'git rev-parse --abbrev-ref HEAD')
return system(a:cdDir . 'git rev-parse --abbrev-ref --short HEAD')
endif
endfunc

Expand Down
3 changes: 1 addition & 2 deletions test/vim-gh-line_test.vim
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func! s:testCommit(sid)
let l:fileDir = resolve(expand("%:p:h"))
let l:cdDir = "cd '" . fileDir . "'; "

let l:branch = system(l:cdDir . 'git rev-parse --abbrev-ref HEAD')
let l:branch = system(l:cdDir . 'git rev-parse --abbrev-ref --short HEAD')

let g:gh_use_canonical = 0
let l:act = s:callWithSID(a:sid, 'Commit', l:cdDir)
Expand Down Expand Up @@ -384,4 +384,3 @@ func! s:tryRunAllTests()
endfunction

command! RunAllTests call s:tryRunAllTests()