protected void AddOrModifyTouchedFile( TouchedFileAction action, string path, string sourcePath, TouchedFile.ContentType type) { path = GitPathToPath(path); sourcePath = GitPathToPath(sourcePath); var touchedFile = touchedFiles.Where(x => x.Path == path).SingleOrDefault(); if (touchedFile == null) { touchedFiles.Add(new TouchedFile() { Path = path, Action = action, SourcePath = sourcePath, Type = type, }); } else { if (touchedFile.Action == TouchedFileAction.MODIFIED && action != TouchedFileAction.MODIFIED) { touchedFile.Action = action; } } }
public ModificationMappingExpression( IRepositoryMappingExpression parentExp, TouchedFileAction action) : base(parentExp) { entity = new Modification() { Action = action, Commit = CurrentEntity <Commit>(), File = CurrentEntity <CodeFile>(), }; Add(entity); }
private void TouchPath( string path, TouchedFileAction action, string sourcePath, string sourceRevision, TouchedFile.ContentType type) { touchedFiles.Add(new TouchedFile() { Path = path, Action = action, SourcePath = sourcePath, SourceRevision = sourceRevision, Type = type, }); }
protected void ModifyTouchedFile( TouchedFileAction action, string path, string sourcePath, TouchedFile.ContentType type) { path = GitPathToPath(path); sourcePath = GitPathToPath(sourcePath); var touchedFile = touchedFiles.SingleOrDefault(x => x.Path == path); if (touchedFile != null) { touchedFile.Action = action; touchedFile.SourcePath = sourcePath; touchedFile.Type = type; } }