Allow archiving when triggering cls

Change-Id: I173fae3b04059a30a59f0e67620fd9e9088ff903
diff --git a/tools/archive.py b/tools/archive.py
index d899943..909faa2 100755
--- a/tools/archive.py
+++ b/tools/archive.py
@@ -52,6 +52,10 @@
 def IsMaster(version):
   branches = subprocess.check_output(['git', 'branch', '-r', '--contains',
                                       'HEAD'])
+  # CL runs from gerrit does not have a branch, we always treat them as master
+  # commits to archive these to the hash based location
+  if len(branches) == 0:
+    return True
   if not version.endswith('-dev'):
     # Sanity check, we don't want to archive on top of release builds EVER
     # Note that even though we branch, we never push the bots to build the same