GitHub PullRequestReviewCommentEvent at 2014-02-28 16:13:02
Repository: objective-git
Actor: joshaber
Payload: {"comment":{"url":"https://api.github.com/repos/libgit2/objective-git/pulls/comments/10169487","id":10169487,"diff_hunk":"@@ -0,0 +1,82 @@\n+//\n+//  GTDiffPatch.m\n+//  ObjectiveGitFramework\n+//\n+//  Created by Justin Spahr-Summers on 2014-02-27.\n+//  Copyright (c) 2014 GitHub, Inc. All rights reserved.\n+//\n+\n+#import \"GTDiffPatch.h\"\n+\n+#import \"GTDiffHunk.h\"\n+\n+@interface GTDiffPatch ()\n+\n+@property (nonatomic, assign, readonly) git_patch *git_patch;\n+\n+@end\n+\n+@implementation GTDiffPatch\n+\n+#pragma mark Lifecycle\n+\n+- (instancetype)initWithGitPatch:(git_patch *)patch delta:(GTDiffDelta *)delta {\n+\tNSParameterAssert(patch != NULL);\n+\tNSParameterAssert(delta != nil);\n+\n+\tself = [super init];\n+\tif (self == nil) return nil;\n+\n+\t_git_patch = patch;\n+\t_delta = delta;\n+\n+\tsize_t adds = 0;\n+\tsize_t deletes = 0;\n+\tsize_t contexts = 0;\n+\tgit_patch_line_stats(&contexts, &adds, &deletes, _git_patch);\n+\n+\t_addedLinesCount = adds;\n+\t_deletedLinesCount = deletes;\n+\t_contextLinesCount = contexts;\n+\n+\treturn self;\n+}\n+\n+- (void)dealloc {\n+\tif (_git_patch != NULL) {\n+\t\tgit_patch_free(_git_patch);\n+\t\t_git_patch = NULL;\n+\t}\n+}\n+\n+#pragma mark Patch Information\n+\n+- (NSUInteger)hunkCount {\n+\treturn git_patch_num_hunks(self.git_patch);\n+}\n+\n+- (NSUInteger)sizeWithContext:(BOOL)includeContext hunkHeaders:(BOOL)includeHunkHeaders fileHeaders:(BOOL)includeFileHeaders {\n+\tint shouldIncludeContext = (includeContext == YES ? 1 : 0);","path":"Classes/GTDiffPatch.m","position":59,"original_position":59,"commit_id":"17bb43b3e0c20003ef3c42808cdfd16227968646","original_commit_id":"17bb43b3e0c20003ef3c42808cdfd16227968646","user":{"login":"joshaber","id":13760,"avatar_url":"https://avatars.githubusercontent.com/u/13760","gravatar_id":"62e8c8bfaa8d755cab82accb48d335c8","url":"https://api.github.com/users/joshaber","html_url":"https://github.com/joshaber","followers_url":"https://api.github.com/users/joshaber/followers","following_url":"https://api.github.com/users/joshaber/following{/other_user}","gists_url":"https://api.github.com/users/joshaber/gists{/gist_id}","starred_url":"https://api.github.com/users/joshaber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joshaber/subscriptions","organizations_url":"https://api.github.com/users/joshaber/orgs","repos_url":"https://api.github.com/users/joshaber/repos","events_url":"https://api.github.com/users/joshaber/events{/privacy}","received_events_url":"https://api.github.com/users/joshaber/received_events","type":"User","site_admin":true},"body":"Style: don't need the explicit compares to `YES` since they're `BOOL`s.","created_at":"2014-02-28T16:13:02Z","updated_at":"2014-02-28T16:13:02Z","html_url":"https://github.com/libgit2/objective-git/pull/334#discussion_r10169487","pull_request_url":"https://api.github.com/repos/libgit2/objective-git/pulls/334","_links":{"self":{"href":"https://api.github.com/repos/libgit2/objective-git/pulls/comments/10169487"},"html":{"href":"https://github.com/libgit2/objective-git/pull/334#discussion_r10169487"},"pull_request":{"href":"https://api.github.com/repos/libgit2/objective-git/pulls/334"}}}}