From: Mike Frysinger Date: Sat, 17 Feb 2018 02:08:54 +0000 (-0500) Subject: git-repack: clean empty dirs X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;ds=sidebyside;h=26447186664b3e900b38322c8745bca62fab1e32;p=home.git git-repack: clean empty dirs --- diff --git a/.bin/git-repack b/.bin/git-repack index bdceb68..063ff81 100755 --- a/.bin/git-repack +++ b/.bin/git-repack @@ -151,6 +151,10 @@ def repack(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))