Fixes for git-commit-id macro

All variables used by git-commit-id (except the output) are now local.
The git command now runs in the repository directory instead of current.
This commit is contained in:
Chris Willis-Ford 2015-07-15 13:34:01 -07:00
parent d011845131
commit ce9a7fd6ff

View file

@ -13,8 +13,9 @@
<attribute name="outputproperty"/>
<sequential>
<local name="git.present"/>
<local name="git.revision"/>
<available file="@{repository}/.git" property="git.present"/>
<exec executable="git" outputproperty="git.revision" failifexecutionfails="false">
<exec executable="git" dir="@{repository}" outputproperty="git.revision" failifexecutionfails="false">
<arg line="describe --dirty --tags --always"/>
</exec>
<condition property="@{outputproperty}" value="${git.revision}" else="unknown">