cli.git: Get the branch name instead of HEAD sometimes.

modern-harvey2
Doug Coleman 2018-01-02 19:47:19 -08:00
parent 72833e950a
commit a52d513883
1 changed files with 2 additions and 1 deletions

View File

@ -33,7 +33,8 @@ cli-git-num-parallel [ cpus 2 * ] initialize
?file-info dup [ directory? ] when ;
: git-current-branch* ( -- name )
{ "git" "rev-parse" "--abbrev-ref" "HEAD" }
! { "git" "rev-parse" "--abbrev-ref" "HEAD" }
{ "git" "name-rev" "--name-only" "HEAD" }
utf8 <process-reader> stream-contents
[ blank? ] trim-tail ;