From c58a781ba2c923d379d1650ead40e5368e8a828a Mon Sep 17 00:00:00 2001
From: murgatroid99 <mlumish@google.com>
Date: Tue, 9 Feb 2016 16:33:17 -0800
Subject: [PATCH] Handle failing git command in check_copyright.py

---
 tools/distrib/check_copyright.py | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/tools/distrib/check_copyright.py b/tools/distrib/check_copyright.py
index ef836d6e2d..d1a34a920d 100755
--- a/tools/distrib/check_copyright.py
+++ b/tools/distrib/check_copyright.py
@@ -131,8 +131,14 @@ def log(cond, why, filename):
 
 # scan files, validate the text
 ok = True
-for filename in subprocess.check_output(FILE_LIST_COMMAND,
-                                        shell=True).splitlines():
+filename_list = []
+try:
+  filename_list = subprocess.check_output(FILE_LIST_COMMAND,
+                                          shell=True).splitlines()
+except subprocess.CalledProcessError:
+  sys.exit(0)
+
+for filename in filename_list:
   if filename in KNOWN_BAD: continue
   ext = os.path.splitext(filename)[1]
   base = os.path.basename(filename)
-- 
GitLab