I just added CGit::GetLibGit2LastErr(CString msg), you might want to use that. here and in line 98