"""Read |path| and return its data"""
if os.path.isfile(path):
return open(path).read()
+ return ''
def unlink(path):
print('Repacking git repo: %s' % ' '.join(cmd))
subprocess.check_call(cmd, cwd='/')
+ # Clean empty dirs.
+ cmd = ['find', rundir, '-depth', '-type', 'd', '-exec', 'rmdir', '{}', '+']
+ subprocess.call(cmd, stderr=open('/dev/null', 'w'))
+
if tmpdir:
cmd = ['rsync', '-a', '--delete', tmpdir + '/', path + '/']
print('Syncing back git repo: %s' % ' '.join(cmd))