Skip to content

Commit

Permalink
change the git checkout logic
Browse files Browse the repository at this point in the history
  • Loading branch information
xius666 committed Sep 30, 2021
1 parent 9511a2b commit e54ca2f
Showing 1 changed file with 18 additions and 35 deletions.
53 changes: 18 additions & 35 deletions system/common.xml
Original file line number Diff line number Diff line change
Expand Up @@ -65,46 +65,29 @@
<equals arg1="${code}" arg2="128"/>
<then>
<echo message="git rev-parse origin/${stf_branch}"/>
<exec executable="git" failonerror="false" dir="${SYSTEMTEST_ROOT}/stf" outputproperty="stf_sha2" resultproperty="code2">
<exec executable="git" failonerror="true" dir="${SYSTEMTEST_ROOT}/stf" outputproperty="stf_sha2" resultproperty="code2">
<arg value="rev-parse"/>
<arg value="origin/${stf_branch}"/>
</exec>
<if>
<equals arg1="${code2}" arg2="128"/>
<then>
<echo message="This branch does not exist!"/>
</then>
</if>
<if>
<isset property="stf_sha2"/>
<then>
<echo message="git checkout -q -f ${stf_sha2} "/>
<exec executable="git" failonerror="true" dir="${SYSTEMTEST_ROOT}/stf" >
<arg value="checkout"/>
<arg value="-q"/>
<arg value="-f"/>
<arg value="${stf_sha2}"/>
</exec>
</then>
</if>
<property property="stf_sha" value="${stf_sha2}"/>
</then>
</if>
<if>
<not>
<isset property="stf_sha"/>
</not>
<then>
<property property="stf_sha" value="${stf_sha1}"/>
</then>
<else>
<if>
<isset property="stf_sha1"/>
<then>
<echo message="git checkout -q -f ${stf_sha1} "/>
<exec executable="git" failonerror="true" dir="${SYSTEMTEST_ROOT}/stf" >
<arg value="checkout"/>
<arg value="-q"/>
<arg value="-f"/>
<arg value="${stf_sha1}"/>
</exec>
</then>
</if>
</else>
</if>


<echo message="git checkout -q -f ${stf_sha} "/>
<exec executable="git" failonerror="true" dir="${SYSTEMTEST_ROOT}/stf" >
<arg value="checkout"/>
<arg value="-q"/>
<arg value="-f"/>
<arg value="${stf_sha}"/>
</exec>



<if>
Expand Down

0 comments on commit e54ca2f

Please sign in to comment.