From 8ec5e72bacd9481f58e0ff625fccf99b670db7e4 Mon Sep 17 00:00:00 2001 From: Benjamin Mako Hill Date: Wed, 25 Jan 2012 17:38:48 -0500 Subject: [PATCH] fix extraneous commits when people are punted Fixes a small bug where the dry_run option still results in commits of to git of the ledger and bloggers.yml when people are punted. I ended up double-charging folks because of this but this should definitely address the issue. --- weekly-update.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/weekly-update.py b/weekly-update.py index 06d8518..284ffb6 100755 --- a/weekly-update.py +++ b/weekly-update.py @@ -81,9 +81,13 @@ if punt: with open('bloggers.yml','w') as b: yaml.safe_dump(bloggers, b) - subprocess.check_call(["git", "commit", "ledger", "bloggers.yml", - "-m", "Punts for %s" % (today,)]) + if not dry_run: + subprocess.check_call(["git", "commit", "ledger", "bloggers.yml", + "-m", "Punts for %s" % (today,)]) # if it's a dry run, lets set the ledger back to the beginning state if dry_run: subprocess.check_call(["git", "checkout", "ledger"]) + + if punt: + subprocess.check_call(["git", "checkout", "bloggers.yml"]) -- 2.39.5