Commit 8e84029a authored by Markus Shepherd's avatar Markus Shepherd

better git gc; v1-5-8

parent 59e64973
1-5-7
\ No newline at end of file
1-5-8
......@@ -93,14 +93,14 @@ def gitupdate(*paths, repo=SCRAPED_DATA_DIR, name=__name__):
paths = paths or ('scraped', 'links.json', 'prefixes.txt')
LOGGER.info('Updating paths %r in Git repo <%s>...', paths, repo)
with safe_cd(repo):
execute('git', 'gc')
execute('git', 'gc', '--prune=now')
execute('git', 'add', '--', *paths)
try:
execute('git', 'commit', '--message', f'automatic commit by <{name}>')
except SystemExit:
LOGGER.info('Nothing to commit...')
else:
execute('git', 'gc')
execute('git', 'gc', '--prune=now')
execute('git', 'push')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment