private static string GetDirectoryName(FileChange f)
{
var fileName = String.IsNullOrEmpty(f.NewFileName) ? f.FileName : f.NewFileName;
int lastSlash = fileName.LastIndexOf('/');
if (lastSlash > -1)
{
return fileName.Substring(0, lastSlash);
}
return null;
}