summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/gitinfo2/gitexinfo.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/gitinfo2/gitexinfo.sty')
-rw-r--r--Master/texmf-dist/tex/latex/gitinfo2/gitexinfo.sty27
1 files changed, 17 insertions, 10 deletions
diff --git a/Master/texmf-dist/tex/latex/gitinfo2/gitexinfo.sty b/Master/texmf-dist/tex/latex/gitinfo2/gitexinfo.sty
index 813fec35b57..78ecb9ea294 100644
--- a/Master/texmf-dist/tex/latex/gitinfo2/gitexinfo.sty
+++ b/Master/texmf-dist/tex/latex/gitinfo2/gitexinfo.sty
@@ -18,10 +18,7 @@
% and gitPseudoHeadInfo.gin
% -----------------------------------------------------
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{gitexinfo}[2014/10/03 v2.0.4 Auxiliary package for gitinfo2]
-\RequirePackage{kvoptions}
-\RequirePackage{xstring}
-\RequirePackage{etoolbox}
+\ProvidesPackage{gitexinfo}[2015/11/08 v2.0.5 Auxiliary package for gitinfo2]
\SetupKeyvalOptions{family=gitinfo,prefix=gitInf@}
\DeclareStringOption{shash}
\DeclareStringOption{lhash}
@@ -73,12 +70,22 @@
}%
}%
\expandafter\docsvlist\expandafter{#1}%
- \StrDel{#1}{)}[\bcut]%
- \StrDel{\bcut}{(HEAD}[\bcut]%
- \StrCount{\bcut}{, }[\xcut]%
- \StrCut[\xcut]{\bcut}{, }{\bcut}{\xcut}%
- \IfEq{\xcut}{}{}{%
- \renewcommand{\gitBranch}{\xcut}%
+ \StrDel{#1}{(}[\bcut]%
+ \StrDel{\bcut}{)}[\bcut]%
+ \IfSubStr{\bcut}{->}{% git version 2+?
+ \StrBetween{\bcut,}{HEAD -> }{,}[\bcut]% yes - no problem
+ }{%
+ \StrCount{\bcut}{, }[\xcut]%
+ \IfEq{\xcut}{0}{% detached head?
+ }{% no
+ \StrCut[\xcut]{\bcut}{, }{\lcut}{\bcut}% git vv < 2 - take last token
+ }% (not always accurate)
+ }
+ \IfEq{\bcut}{}{}{%
+ \IfEq{\bcut}{HEAD}{% detached head?
+ }{% no - we have the branch name
+ \renewcommand{\gitBranch}{\bcut}%
+ }%
}%
}%
\newcommand{\git@taglist}[1]{%