gc.sh: pack all refs at mini gc time
commit717145346113acd4696766ca882dda1ee4402d14
authorKyle J. McKay <mackyle@gmail.com>
Sun, 25 Feb 2018 00:37:42 +0000 (24 16:37 -0800)
committerKyle J. McKay <mackyle@gmail.com>
Sun, 25 Feb 2018 00:37:42 +0000 (24 16:37 -0800)
tree83e50943dd551fa23a3781fb7def5c1fec864c30
parent18b972f22f4ad47545169bc2f7e4a6d035347ba3
gc.sh: pack all refs at mini gc time

If we're generating a lot of packs for some reason there's a
possibility we've also generated a lot of new refs.

When "mini" gc actually decides to do repacking (other than
.needspack or forced gfi_packs early redeltaing), go ahead
and pack all refs too.

Some repositories notoriously generate a lot of new refs on
every fetch.  Waiting until the next full gc to pack up all
those loose refs makes access to the repository much less
efficient than it needs to be.

For other repositories that haven't added any new refs or
have only added a few, the pack-refs command will be very,
very fast.  Even in a repository with a lot of new loose
refs it will still be faster than the time spent doing the
rest of the "mini" gc and is time well spent.

Signed-off-by: Kyle J. McKay <mackyle@gmail.com>
jobd/gc.sh