gc.sh: make repack_gfi_packs more robust and scalable
The new pack(s) produced by pack-objects shouldn't experience any
name collision with pre-existing packs, but shouldn't doesn't mean
impossible, so move any such packs aside rather than removing them
assuming they're redundant.
There should only be a handful of fast-import packs that need to
be repacked, but should doesn't mean must. Alter the gfi_repack_code
so that in the extremely unlikely event of thousands of packs, the
code still works and does not overflow any command line length
limitations.
Finally, after creating a new replacement pack for the fast-import-
created packs, remove the fast-import packs being replaced as they're
redundant and could potentially cause the final gc to produce a less
optimal result.
Also, if pack-objects fails for any reason, return with failure and
do not remove any packs at all.
Signed-off-by: Kyle J. McKay <mackyle@gmail.com>