gc.sh: keep a backup copy of packed-refs in repack dir
commit3a3fffefb9e13f88f0b169dc034cd810407ac65f
authorKyle J. McKay <mackyle@gmail.com>
Sat, 9 Dec 2017 23:02:31 +0000 (9 15:02 -0800)
committerKyle J. McKay <mackyle@gmail.com>
Sat, 9 Dec 2017 23:02:31 +0000 (9 15:02 -0800)
tree8f2a57021706fd188ec017e24940d664036f4bf7
parent50eb7c96b09d49d228028c6edb2a6b5954ea10cb
gc.sh: keep a backup copy of packed-refs in repack dir

When calling make_repack_dir, keep a backup copy of the original
packed-refs file in the repack subdirectory as packed-refs.orig.

While repacking is in progress, any incoming ref deletions will
modify the original packed-refs file, but incoming branch additions
and/or updates will not.

Creating a bundle header from that packed-refs file could then
produce a set of refs that never actually existed at any point
in time.  We can avoid this by using a backup copy of the original
packed-refs file that's immune to ref deletions.

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