Modify adt to use symbolic-ref
authorGan Shun <ganshun@gmail.com>
Thu, 8 Jun 2017 21:35:04 +0000 (14:35 -0700)
committerBarret Rhoden <brho@cs.berkeley.edu>
Thu, 8 Jun 2017 21:51:30 +0000 (17:51 -0400)
Signed-off-by: Gan Shun <ganshun@gmail.com>
Change-Id: I941e805029753bf543a0f75876f3bbe4e32de7de
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
scripts/git/adt

index f74165d..a865523 100755 (executable)
@@ -3,7 +3,7 @@
 # Copyright 2016 Google Inc
 
 # Use local branch name as the default topic unless overridden
-GERRIT_TOPIC=`git status | grep "branch .*" | rev | cut -f 1 -d " " | rev`
+GERRIT_TOPIC=`git symbolic-ref -q --short HEAD`
 
 GERRIT_REMOTE=gerrit
 GERRIT_PUSH_COMMAND="git push $GERRIT_REMOTE HEAD:refs/for/master"