From 07b8277475766641668ebc65a12d92a6c92b208b Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Sat, 24 Jul 2021 07:32:29 -0400 Subject: [PATCH] Move FugitiveHead() documentation to plugin file --- doc/fugitive.txt | 6 ------ plugin/fugitive.vim | 7 +++++++ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/doc/fugitive.txt b/doc/fugitive.txt index efa2d77..6e55b64 100644 --- a/doc/fugitive.txt +++ b/doc/fugitive.txt @@ -601,12 +601,6 @@ a statusline, this one matches the default when 'ruler' is set: > set statusline=%<%f\ %h%m%r%{FugitiveStatusline()}%=%-14.(%l,%c%V%)\ %P < - *FugitiveHead(...)* *fugitive#head(...)* -Use FugitiveHead() to return the name of the current branch. If the current -HEAD is detached, FugitiveHead() will return the empty string, unless the -optional argument is given, in which case the hash of the current commit will -be truncated to the given number of characters. - DEPRECATIONS *fugitive-deprecated* The following commands are softly deprecated in favor of replacements that diff --git a/plugin/fugitive.vim b/plugin/fugitive.vim index 8b2f54f..b4bc2a0 100644 --- a/plugin/fugitive.vim +++ b/plugin/fugitive.vim @@ -156,6 +156,13 @@ function! FugitiveRemoteUrl(...) abort return fugitive#RemoteUrl(a:0 ? a:1 : '', FugitiveGitDir(a:0 > 1 ? a:2 : -1), a:0 > 2 ? a:3 : 0) endfunction +" FugitiveHead() retrieves the name of the current branch. If the current HEAD +" is detached, FugitiveHead() will return the empty string, unless the +" optional argument is given, in which case the hash of the current commit +" will be truncated to the given number of characters. +" +" An optional second argument provides the Git dir, or the buffer number of a +" buffer with a Git dir. The default is the current buffer. function! FugitiveHead(...) abort let dir = FugitiveGitDir(a:0 > 1 ? a:2 : -1) if empty(dir)