"""Read |path| and return its data"""
if os.path.isfile(path):
return open(path).read()
+ return ''
def unlink(path):
else:
rundir = path
+ cmd = ['git', '--git-dir', rundir, 'reflog', 'expire', '--all', '--stale-fix']
+ print('Cleaning reflog: %s' % ' '.join(cmd))
+ subprocess.check_call(cmd, cwd='/')
+
# This also packs refs/tags for us.
cmd = ['git', '--git-dir', rundir, 'gc', '--aggressive', '--prune=all']
print('Repacking git repo: %s' % ' '.join(cmd))