From 26447186664b3e900b38322c8745bca62fab1e32 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Fri, 16 Feb 2018 21:08:54 -0500 Subject: [PATCH] git-repack: clean empty dirs --- .bin/git-repack | 4 ++++ 1 file changed, 4 insertions(+) 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)) -- 2.39.5