static ErrorStatus FindError(string line)
{
ErrorStatus error = ErrorStatus.None;
if (line.Contains ("WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!") ||
line.Contains ("WARNING: POSSIBLE DNS SPOOFING DETECTED!")) {
error = ErrorStatus.HostIdentityChanged;
}
if (line.StartsWith ("Permission denied") ||
line.StartsWith ("ssh_exchange_identification: Connection closed by remote host") ||
line.StartsWith ("The authenticity of host")) {
error = ErrorStatus.AuthenticationFailed;
}
if (line.EndsWith ("does not appear to be a git repository"))
error = ErrorStatus.NotFound;
if (line.EndsWith ("expected old/new/ref, got 'shallow"))
error = ErrorStatus.IncompatibleClientServer;
if (line.StartsWith ("error: Disk space exceeded") ||
line.EndsWith ("No space left on device") ||
line.EndsWith ("file write error (Disk quota exceeded)")) {
error = ErrorStatus.DiskSpaceExceeded;
}
return error;
}