Use more robust command for getting branches that a commit is on

Bug: 67491672
Change-Id: I2719777d1161eb95e2dea9071dff72b9fb3eaa75
diff --git a/tools/archive.py b/tools/archive.py
index 0ae7233..4e36724 100755
--- a/tools/archive.py
+++ b/tools/archive.py
@@ -29,7 +29,7 @@
   return subprocess.check_output(['git', 'rev-parse', 'HEAD']).strip()
 
 def IsMaster(version):
-  branches = subprocess.check_output(['git', 'show', '-s', '--pretty=%d',
+  branches = subprocess.check_output(['git', 'branch', '-r', '--contains',
                                       'HEAD'])
   if not version.endswith('-dev'):
     # Sanity check, we don't want to archive on top of release builds EVER