private Task Open(string filePath) { var status = repository.RetrieveStatus(new StatusOptions { PathSpec = new[] { filePath } })[filePath]; if (status == null) { return(Task.CompletedTask); } switch (status.State) { case FileStatus.NewInIndex: case FileStatus.NewInWorkdir: case FileStatus.RenamedInIndex: case FileStatus.RenamedInWorkdir: case FileStatus.Unaltered: RunTool(editorTool, repository.GetFullPath(filePath)); break; case FileStatus.ModifiedInIndex: case FileStatus.ModifiedInWorkdir: Diff(filePath); break; default: return(Task.CompletedTask); } return(Task.CompletedTask); }