[misc] 01/04: Don't worry about calls to git - not worth a global statement

Chris Lamb chris at chris-lamb.co.uk
Sun Aug 28 00:39:39 UTC 2016


This is an automated email from the git hooks/post-receive script.

lamby pushed a commit to branch master
in repository misc.

commit ba80dfd0638ef4db1ed132b681278d1df48c97b3
Author: Chris Lamb <lamby at debian.org>
Date:   Sun Aug 28 00:59:02 2016 +0100

    Don't worry about calls to git - not worth a global statement
---
 reports/bin/generate-draft | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/reports/bin/generate-draft b/reports/bin/generate-draft
index 476bb97..25bd4b7 100755
--- a/reports/bin/generate-draft
+++ b/reports/bin/generate-draft
@@ -13,7 +13,6 @@ import debianbts
 import subprocess
 import collections
 
-REPO_PARENT = None
 WEEK_1_END = 1430611200 # May 3 2015, 00:00 UTC, Sunday
 
 PROJECTS = (
@@ -45,11 +44,13 @@ def prev_week():
     return ((now - WEEK_1_END) // (7*24*3600) + 1)
 
 def sibling_repo_gitdir(path):
-    global REPO_PARENT
-    if not REPO_PARENT:
-        REPO_PARENT = os.path.dirname(subprocess.check_output(
-            ['git', 'rev-parse', '--show-toplevel']).decode('utf-8'))
-    return os.path.join(REPO_PARENT, path, '.git')
+    toplevel = os.path.dirname(subprocess.check_output((
+        'git',
+        'rev-parse',
+        '--show-toplevel',
+    )).decode('utf-8'))
+
+    return os.path.join(toplevel, path, '.git')
 
 def ensure_dir(path):
     if not os.path.isdir(path):

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/misc.git



More information about the Reproducible-commits mailing list