]> git.wh0rd.org Git - home.git/commitdiff
git-repack: trim reflog history too
authorMike Frysinger <vapier@gentoo.org>
Thu, 18 Feb 2016 06:36:47 +0000 (01:36 -0500)
committerMike Frysinger <vapier@gentoo.org>
Thu, 18 Feb 2016 06:36:47 +0000 (01:36 -0500)
.bin/git-repack

index d218a99944482f651032c924596f3172e2b18708..b225fca147d19e2ecbc3e9a5f236e99f74e9107b 100755 (executable)
@@ -141,6 +141,10 @@ def repack(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))