From 4118138cf070745cf4f7036af6fcdf8b2a2930e2 Mon Sep 17 00:00:00 2001 From: winlin Date: Mon, 24 Aug 2015 10:54:31 +0800 Subject: [PATCH] update commit script --- trunk/scripts/git.commit.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/trunk/scripts/git.commit.sh b/trunk/scripts/git.commit.sh index e6f1e0d7c..863cbf98a 100755 --- a/trunk/scripts/git.commit.sh +++ b/trunk/scripts/git.commit.sh @@ -23,7 +23,8 @@ work_dir=`(cd ${work_dir}/.. && pwd)` product_dir=$work_dir # allow start script from any dir -cd $work_dir && git checkout 2.0release +cd $work_dir && work_branch=`git branch -a|grep "*"|awk '{print $2}'` && git checkout 2.0release +ret=$"; if [[ $ret -ne 0 ]]; then echo "switch branch failed. ret=$ret"; exit $ret; fi . ${product_dir}/scripts/_log.sh ret=$?; if [[ $ret -ne 0 ]]; then exit $ret; fi @@ -76,4 +77,7 @@ sync_push --tags srs.oschina sync_push --tags srs.gitlab ok_msg "push tags ok" +git checkout $work_branch +ok_msg "switch to work branch $work_branch" + exit 0