Use libgit2 for checking for orphaned HEAD