shlib.sh: make has_forks_with_alternates smarter
Previously, when determining whether or not a project has any
alternates, if a non-zero length <proj>/objects/info/alternates
file exists it's considered to have alternates.
But that can result in false positives since Git actually disregards
any comment lines (first character of the line is a '#') or blank
lines (no whitespace allowed) in the alternates file.
This check is important because it gates:
1) an extra step during the gc process that will be skipped if
there are no forks with alternates
2) creation of a bundle which will be skipped if the project
itself has any alternates
Add an extra check in the case of a non-zero length alternates
file just to make sure that it's not actually empty after all
(i.e. contains only blank lines and comments).
Make this check available as the new is_empty_alternates_file
shell function rather than hiding it inside has_forks_with_alternates.
Signed-off-by: Kyle J. McKay <mackyle@gmail.com>