This is probably not a very fulfilling fix, but it addresses the issue
that for at least one of the test cases involving a rebase, the commit
that is recorded as the starting point of the rebase exists in the
submodule's remote but not in the non-bare submodule.
Since WriteRepoASTUtil is only used from either test code or
test-oriented utilities (generate-repos and write-repo), it seems safe
to skip the GC.
Arguably, this points to a real bug somewhere if this commit is unrooted
and therefore prone to being GC'd, but I think that bug is lives
entirely within the repo AST stuff (in generating a repo that's in the
middle of a rebase), so this probably does not paper over a problem that
could impact real git-meta users.
This is probably not a very fulfilling fix, but it addresses the issue that for at least one of the test cases involving a rebase, the commit that is recorded as the starting point of the rebase exists in the submodule's remote but not in the non-bare submodule.
Since WriteRepoASTUtil is only used from either test code or test-oriented utilities (generate-repos and write-repo), it seems safe to skip the GC.
Arguably, this points to a real bug somewhere if this commit is unrooted and therefore prone to being GC'd, but I think that bug is lives entirely within the repo AST stuff (in generating a repo that's in the middle of a rebase), so this probably does not paper over a problem that could impact real git-meta users.