Эх сурвалжийг харах

metrics_utils: Fallback to HEAD if upstream is None.

Bug: 934494
Change-Id: I31035d78888747386a37d4a8b05c148aaed37529
Reviewed-on: https://chromium-review.googlesource.com/c/1481937
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Edward Lemur 6 жил өмнө
parent
commit
36974ad871
1 өөрчлөгдсөн 1 нэмэгдсэн , 1 устгасан
  1. 1 1
      metrics_utils.py

+ 1 - 1
metrics_utils.py

@@ -260,7 +260,7 @@ def get_repo_timestamp(path_to_repo):
   # Get the upstream for the current branch. If we're not in a branch, fallback
   # to HEAD.
   try:
-    upstream = scm.GIT.GetUpstreamBranch(path_to_repo)
+    upstream = scm.GIT.GetUpstreamBranch(path_to_repo) or 'HEAD'
   except subprocess2.CalledProcessError:
     upstream = 'HEAD'