[#5879] Fixed ordering of all_commit_ids for ForgeGit to ensure repo root always comes last

The performance of refresh_last_commits depends on the repo root being
processed first and the commits following in roughly story (a.k.a.
topological) order.  If the commits are processed out of order, it has
to walk back up the tree a *lot* more to reconstruct last-commit data
that it otherwise gets for "free" (having already computed it).

Signed-off-by: Cory Johns <cjohns@slashdotmedia.com>
[#5879] Fixed error from all_commit_ids on empty git repo

Signed-off-by: Cory Johns <cjohns@slashdotmedia.com>
[#5879] Fixed tests failing due to new commit in test repo

Signed-off-by: Cory Johns <cjohns@slashdotmedia.com>