gc.sh: avoid unlikely ref name repack duplication
When repacking during gc, a substitute packed-refs file gets created
to make sure that everything that needs to, ends up getting packed
properly.
However, in order to avoid breaking internal symbolic refs the
original heads, notes and remotes refs namespace gets duplicated
exactly in the substitute packed-refs file with one exception.
A special additional heads ref gets added just to make sure there's
always at least one "heads" ref present.
While it's very unlikely that the name used for the additional heads
ref would be used in practice, it could happen and that would result
in two lines for the same ref name but with different values for
the hash. Git might perhaps object strongly to that. Let's not
find out.
Instead suppress the duplicate (from the original ref space) just
in case such a scenario ever occurs. The actual original ref value
appears elsewhere under a separate partition of the substitute
packed-refs refs namespace so there's no danger of losing any
objects. As for it being the target of an internal symbolic ref,
only the presence of the target is important to avoid breakage, not
the actual value, which works out quite well in this case.
Signed-off-by: Kyle J. McKay <mackyle@gmail.com>