gc.sh: accomodate symbolically linked objects parts
commit1e200d59115462b0de60bd0ae2f7cd1668a7ef34
authorKyle J. McKay <mackyle@gmail.com>
Wed, 20 Dec 2017 22:11:41 +0000 (20 14:11 -0800)
committerKyle J. McKay <mackyle@gmail.com>
Wed, 20 Dec 2017 22:11:41 +0000 (20 14:11 -0800)
tree06fef97041503956c8a2f340b6bfc7952aa7a427
parent28555f546f9ed5ad7775b3eae3cdc59ffdaa1837
gc.sh: accomodate symbolically linked objects parts

With the switchover to "gc the new order", new packs are initially
created outside of the "objects/pack" directory during the initial
part of gc and then later moved (via hard link + remove original)
into the appropriate "objects/pack" directory.

If the objects and/or objects/pack directories happen to be symbolic
links to somewhere else that final "move into place" would fail if
the final destination ends up on another device courtesy of a
symbolic link.

Accomodate this situation by making the "repack/alt/pack" directory
(where new packs are initially created by gc) actually be a symbolic
link to an "objects/pack/repack" directory (created by the gc process
and then removed at the end of gc).

This way success is pretty much guaranteed for the hard-linking
move of the gc-created pack(s) back into "objects/pack".

This does not, unfortunately, do anything to address any potential
cross-device hard-linking issues that may arise when hard-linking
items from the forkee into its fork(s).

But that is a separate issue which has always existed and this
change neither improves nor worsens that situation.

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