diff --git a/apollo.sh b/apollo.sh index 3d5e60f84dfeaf29d0e54c936b233ccb29e004fe..6764ed4b1dfef9c43d167016a5d9a8cbd1f10043 100755 --- a/apollo.sh +++ b/apollo.sh @@ -285,6 +285,7 @@ function release() { # release info META="${APOLLO_RELEASE_DIR}/meta.ini" echo "git_commit: $(get_revision)" >> $META + echo "git_branch: $(get_branch)" >> $META echo "car_type: LINCOLN.MKZ" >> $META echo "arch: ${MACHINE_ARCH}" >> $META } @@ -443,6 +444,17 @@ function get_revision() { echo "$REVISION" } +function get_branch() { + git branch &> /dev/null + if [ $? = 0 ];then + BRANCH=$(git rev-parse --abbrev-ref HEAD) + else + warning "Could not get the branch name, maybe this is not a git work tree." >&2 + BRANCH="unknown" + fi + echo "$BRANCH" +} + function build_velodyne() { CURRENT_PATH=$(pwd) if [ -d "${ROS_ROOT}" ]; then