From 36974ad871c99ded00255730b1d2b3216910d46d Mon Sep 17 00:00:00 2001 From: Edward Lemur Date: Thu, 21 Feb 2019 23:29:47 +0000 Subject: [PATCH] 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 Commit-Queue: Edward Lesmes --- metrics_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metrics_utils.py b/metrics_utils.py index dc5372655..ed908cb1c 100644 --- a/metrics_utils.py +++ b/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'