{"action":"created","comment":{"url":"https://api.github.com/repos/libgit2/objective-git/pulls/comments/32741557","id":32741557,"diff_hunk":"@@ -0,0 +1,118 @@\n+//\n+//  GTRepository+Pull.m\n+//  ObjectiveGitFramework\n+//\n+//  Created by Ben Chatelain on 6/17/15.\n+//  Copyright © 2015 GitHub, Inc. All rights reserved.\n+//\n+\n+#import \"GTRepository+Pull.h\"\n+\n+#import \"GTCommit.h\"\n+#import \"GTRemote.h\"\n+#import \"GTRepository+Committing.h\"\n+#import \"GTRepository+RemoteOperations.h\"\n+#import \"git2/merge.h\"\n+\n+@implementation GTRepository (Pull)\n+\n+#pragma mark - Pull\n+\n+- (BOOL)pullBranch:(GTBranch *)branch fromRemote:(GTRemote *)remote withOptions:(NSDictionary *)options\n+\t\t\t error:(NSError **)error progress:(GTRemoteFetchTransferProgressBlock)progressBlock\n+{\n+\tNSParameterAssert(branch);\n+\tNSParameterAssert(remote);\n+\n+\tGTRepository *repo = remote.repository;\n+\n+\tGTBranch *remoteBranch;\n+\tif (branch.branchType == GTBranchTypeLocal) {\n+\t\tBOOL success;\n+\t\tremoteBranch = [branch trackingBranchWithError:error success:&success];\n+\t\tif (!success) {\n+\t\t\treturn NO;\n+\t\t}\n+\t}\n+\telse {\n+\t\tremoteBranch = branch;\n+\t}\n+\n+\tif (![self fetchRemote:remote withOptions:options error:error progress:progressBlock]) {\n+\t\treturn NO;\n+\t}\n+\n+\t// Check if merge is necessary\n+\tGTBranch *localBranch = [repo currentBranchWithError:error];\n+\tif (*error) {","path":"ObjectiveGit/GTRepository+Pull.m","position":47,"original_position":47,"commit_id":"f7133265b42d844b5cbfca53b6aeb47f3908cac0","original_commit_id":"5aae55ab74ec8cb988d477a76ffb193994a3b428","user":{"login":"phatblat","id":28851,"avatar_url":"https://avatars.githubusercontent.com/u/28851?v=3","gravatar_id":"","url":"https://api.github.com/users/phatblat","html_url":"https://github.com/phatblat","followers_url":"https://api.github.com/users/phatblat/followers","following_url":"https://api.github.com/users/phatblat/following{/other_user}","gists_url":"https://api.github.com/users/phatblat/gists{/gist_id}","starred_url":"https://api.github.com/users/phatblat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phatblat/subscriptions","organizations_url":"https://api.github.com/users/phatblat/orgs","repos_url":"https://api.github.com/users/phatblat/repos","events_url":"https://api.github.com/users/phatblat/events{/privacy}","received_events_url":"https://api.github.com/users/phatblat/received_events","type":"User","site_admin":false},"body":"Good catch. Using the user-supplied error pointer for control flow is messy, and dangerous :boom: .","created_at":"2015-06-18T15:20:07Z","updated_at":"2015-06-18T15:20:07Z","html_url":"https://github.com/libgit2/objective-git/pull/464#discussion_r32741557","pull_request_url":"https://api.github.com/repos/libgit2/objective-git/pulls/464","_links":{"self":{"href":"https://api.github.com/repos/libgit2/objective-git/pulls/comments/32741557"},"html":{"href":"https://github.com/libgit2/objective-git/pull/464#discussion_r32741557"},"pull_request":{"href":"https://api.github.com/repos/libgit2/objective-git/pulls/464"}}},"pull_request":{"url":"https://api.github.com/repos/libgit2/objective-git/pulls/464","id":37937012,"html_url":"https://github.com/libgit2/objective-git/pull/464","diff_url":"https://github.com/libgit2/objective-git/pull/464.diff","patch_url":"https://github.com/libgit2/objective-git/pull/464.patch","issue_url":"https://api.github.com/repos/libgit2/objective-git/issues/464","number":464,"state":"open","locked":false,"title":"[WIP] Pull","user":{"login":"phatblat","id":28851,"avatar_url":"https://avatars.githubusercontent.com/u/28851?v=3","gravatar_id":"","url":"https://api.github.com/users/phatblat","html_url":"https://github.com/phatblat","followers_url":"https://api.github.com/users/phatblat/followers","following_url":"https://api.github.com/users/phatblat/following{/other_user}","gists_url":"https://api.github.com/users/phatblat/gists{/gist_id}","starred_url":"https://api.github.com/users/phatblat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phatblat/subscriptions","organizations_url":"https://api.github.com/users/phatblat/orgs","repos_url":"https://api.github.com/users/phatblat/repos","events_url":"https://api.github.com/users/phatblat/events{/privacy}","received_events_url":"https://api.github.com/users/phatblat/received_events","type":"User","site_admin":false},"body":"Starting work on pull. Right now this is just a happy-path implementation that may not deal with conflicts well (if at all). Also, needs tests.\r\n\r\nCreated shared /pull branch and PR so that @pietbrauer and I can discuss and work on this together.","created_at":"2015-06-17T19:25:01Z","updated_at":"2015-06-18T15:20:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"dff03ef5e54ec09df7650ebfe5f3b09e5cff5402","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/libgit2/objective-git/pulls/464/commits","review_comments_url":"https://api.github.com/repos/libgit2/objective-git/pulls/464/comments","review_comment_url":"https://api.github.com/repos/libgit2/objective-git/pulls/comments{/number}","comments_url":"https://api.github.com/repos/libgit2/objective-git/issues/464/comments","statuses_url":"https://api.github.com/repos/libgit2/objective-git/statuses/f7133265b42d844b5cbfca53b6aeb47f3908cac0","head":{"label":"libgit2:pull","ref":"pull","sha":"f7133265b42d844b5cbfca53b6aeb47f3908cac0","user":{"login":"libgit2","id":394745,"avatar_url":"https://avatars.githubusercontent.com/u/394745?v=3","gravatar_id":"","url":"https://api.github.com/users/libgit2","html_url":"https://github.com/libgit2","followers_url":"https://api.github.com/users/libgit2/followers","following_url":"https://api.github.com/users/libgit2/following{/other_user}","gists_url":"https://api.github.com/users/libgit2/gists{/gist_id}","starred_url":"https://api.github.com/users/libgit2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/libgit2/subscriptions","organizations_url":"https://api.github.com/users/libgit2/orgs","repos_url":"https://api.github.com/users/libgit2/repos","events_url":"https://api.github.com/users/libgit2/events{/privacy}","received_events_url":"https://api.github.com/users/libgit2/received_events","type":"Organization","site_admin":false},"repo":{"id":1427977,"name":"objective-git","full_name":"libgit2/objective-git","owner":{"login":"libgit2","id":394745,"avatar_url":"https://avatars.githubusercontent.com/u/394745?v=3","gravatar_id":"","url":"https://api.github.com/users/libgit2","html_url":"https://github.com/libgit2","followers_url":"https://api.github.com/users/libgit2/followers","following_url":"https://api.github.com/users/libgit2/following{/other_user}","gists_url":"https://api.github.com/users/libgit2/gists{/gist_id}","starred_url":"https://api.github.com/users/libgit2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/libgit2/subscriptions","organizations_url":"https://api.github.com/users/libgit2/orgs","repos_url":"https://api.github.com/users/libgit2/repos","events_url":"https://api.github.com/users/libgit2/events{/privacy}","received_events_url":"https://api.github.com/users/libgit2/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/libgit2/objective-git","description":"Objective-C bindings to libgit2","fork":false,"url":"https://api.github.com/repos/libgit2/objective-git","forks_url":"https://api.github.com/repos/libgit2/objective-git/forks","keys_url":"https://api.github.com/repos/libgit2/objective-git/keys{/key_id}","collaborators_url":"https://api.github.com/repos/libgit2/objective-git/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/libgit2/objective-git/teams","hooks_url":"https://api.github.com/repos/libgit2/objective-git/hooks","issue_events_url":"https://api.github.com/repos/libgit2/objective-git/issues/events{/number}","events_url":"https://api.github.com/repos/libgit2/objective-git/events","assignees_url":"https://api.github.com/repos/libgit2/objective-git/assignees{/user}","branches_url":"https://api.github.com/repos/libgit2/objective-git/branches{/branch}","tags_url":"https://api.github.com/repos/libgit2/objective-git/tags","blobs_url":"https://api.github.com/repos/libgit2/objective-git/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/libgit2/objective-git/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/libgit2/objective-git/git/refs{/sha}","trees_url":"https://api.github.com/repos/libgit2/objective-git/git/trees{/sha}","statuses_url":"https://api.github.com/repos/libgit2/objective-git/statuses/{sha}","languages_url":"https://api.github.com/repos/libgit2/objective-git/languages","stargazers_url":"https://api.github.com/repos/libgit2/objective-git/stargazers","contributors_url":"https://api.github.com/repos/libgit2/objective-git/contributors","subscribers_url":"https://api.github.com/repos/libgit2/objective-git/subscribers","subscription_url":"https://api.github.com/repos/libgit2/objective-git/subscription","commits_url":"https://api.github.com/repos/libgit2/objective-git/commits{/sha}","git_commits_url":"https://api.github.com/repos/libgit2/objective-git/git/commits{/sha}","comments_url":"https://api.github.com/repos/libgit2/objective-git/comments{/number}","issue_comment_url":"https://api.github.com/repos/libgit2/objective-git/issues/comments{/number}","contents_url":"https://api.github.com/repos/libgit2/objective-git/contents/{+path}","compare_url":"https://api.github.com/repos/libgit2/objective-git/compare/{base}...{head}","merges_url":"https://api.github.com/repos/libgit2/objective-git/merges","archive_url":"https://api.github.com/repos/libgit2/objective-git/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/libgit2/objective-git/downloads","issues_url":"https://api.github.com/repos/libgit2/objective-git/issues{/number}","pulls_url":"https://api.github.com/repos/libgit2/objective-git/pulls{/number}","milestones_url":"https://api.github.com/repos/libgit2/objective-git/milestones{/number}","notifications_url":"https://api.github.com/repos/libgit2/objective-git/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/libgit2/objective-git/labels{/name}","releases_url":"https://api.github.com/repos/libgit2/objective-git/releases{/id}","created_at":"2011-03-01T21:28:58Z","updated_at":"2015-06-14T17:03:25Z","pushed_at":"2015-06-18T15:07:09Z","git_url":"git://github.com/libgit2/objective-git.git","ssh_url":"git@github.com:libgit2/objective-git.git","clone_url":"https://github.com/libgit2/objective-git.git","svn_url":"https://github.com/libgit2/objective-git","homepage":"","size":65794,"stargazers_count":697,"watchers_count":697,"language":"Objective-C","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":168,"mirror_url":null,"open_issues_count":23,"forks":168,"open_issues":23,"watchers":697,"default_branch":"master"}},"base":{"label":"libgit2:master","ref":"master","sha":"d4e18a9168043f61afaccc2f8035c485a227b533","user":{"login":"libgit2","id":394745,"avatar_url":"https://avatars.githubusercontent.com/u/394745?v=3","gravatar_id":"","url":"https://api.github.com/users/libgit2","html_url":"https://github.com/libgit2","followers_url":"https://api.github.com/users/libgit2/followers","following_url":"https://api.github.com/users/libgit2/following{/other_user}","gists_url":"https://api.github.com/users/libgit2/gists{/gist_id}","starred_url":"https://api.github.com/users/libgit2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/libgit2/subscriptions","organizations_url":"https://api.github.com/users/libgit2/orgs","repos_url":"https://api.github.com/users/libgit2/repos","events_url":"https://api.github.com/users/libgit2/events{/privacy}","received_events_url":"https://api.github.com/users/libgit2/received_events","type":"Organization","site_admin":false},"repo":{"id":1427977,"name":"objective-git","full_name":"libgit2/objective-git","owner":{"login":"libgit2","id":394745,"avatar_url":"https://avatars.githubusercontent.com/u/394745?v=3","gravatar_id":"","url":"https://api.github.com/users/libgit2","html_url":"https://github.com/libgit2","followers_url":"https://api.github.com/users/libgit2/followers","following_url":"https://api.github.com/users/libgit2/following{/other_user}","gists_url":"https://api.github.com/users/libgit2/gists{/gist_id}","starred_url":"https://api.github.com/users/libgit2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/libgit2/subscriptions","organizations_url":"https://api.github.com/users/libgit2/orgs","repos_url":"https://api.github.com/users/libgit2/repos","events_url":"https://api.github.com/users/libgit2/events{/privacy}","received_events_url":"https://api.github.com/users/libgit2/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/libgit2/objective-git","description":"Objective-C bindings to libgit2","fork":false,"url":"https://api.github.com/repos/libgit2/objective-git","forks_url":"https://api.github.com/repos/libgit2/objective-git/forks","keys_url":"https://api.github.com/repos/libgit2/objective-git/keys{/key_id}","collaborators_url":"https://api.github.com/repos/libgit2/objective-git/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/libgit2/objective-git/teams","hooks_url":"https://api.github.com/repos/libgit2/objective-git/hooks","issue_events_url":"https://api.github.com/repos/libgit2/objective-git/issues/events{/number}","events_url":"https://api.github.com/repos/libgit2/objective-git/events","assignees_url":"https://api.github.com/repos/libgit2/objective-git/assignees{/user}","branches_url":"https://api.github.com/repos/libgit2/objective-git/branches{/branch}","tags_url":"https://api.github.com/repos/libgit2/objective-git/tags","blobs_url":"https://api.github.com/repos/libgit2/objective-git/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/libgit2/objective-git/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/libgit2/objective-git/git/refs{/sha}","trees_url":"https://api.github.com/repos/libgit2/objective-git/git/trees{/sha}","statuses_url":"https://api.github.com/repos/libgit2/objective-git/statuses/{sha}","languages_url":"https://api.github.com/repos/libgit2/objective-git/languages","stargazers_url":"https://api.github.com/repos/libgit2/objective-git/stargazers","contributors_url":"https://api.github.com/repos/libgit2/objective-git/contributors","subscribers_url":"https://api.github.com/repos/libgit2/objective-git/subscribers","subscription_url":"https://api.github.com/repos/libgit2/objective-git/subscription","commits_url":"https://api.github.com/repos/libgit2/objective-git/commits{/sha}","git_commits_url":"https://api.github.com/repos/libgit2/objective-git/git/commits{/sha}","comments_url":"https://api.github.com/repos/libgit2/objective-git/comments{/number}","issue_comment_url":"https://api.github.com/repos/libgit2/objective-git/issues/comments{/number}","contents_url":"https://api.github.com/repos/libgit2/objective-git/contents/{+path}","compare_url":"https://api.github.com/repos/libgit2/objective-git/compare/{base}...{head}","merges_url":"https://api.github.com/repos/libgit2/objective-git/merges","archive_url":"https://api.github.com/repos/libgit2/objective-git/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/libgit2/objective-git/downloads","issues_url":"https://api.github.com/repos/libgit2/objective-git/issues{/number}","pulls_url":"https://api.github.com/repos/libgit2/objective-git/pulls{/number}","milestones_url":"https://api.github.com/repos/libgit2/objective-git/milestones{/number}","notifications_url":"https://api.github.com/repos/libgit2/objective-git/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/libgit2/objective-git/labels{/name}","releases_url":"https://api.github.com/repos/libgit2/objective-git/releases{/id}","created_at":"2011-03-01T21:28:58Z","updated_at":"2015-06-14T17:03:25Z","pushed_at":"2015-06-18T15:07:09Z","git_url":"git://github.com/libgit2/objective-git.git","ssh_url":"git@github.com:libgit2/objective-git.git","clone_url":"https://github.com/libgit2/objective-git.git","svn_url":"https://github.com/libgit2/objective-git","homepage":"","size":65794,"stargazers_count":697,"watchers_count":697,"language":"Objective-C","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":168,"mirror_url":null,"open_issues_count":23,"forks":168,"open_issues":23,"watchers":697,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/libgit2/objective-git/pulls/464"},"html":{"href":"https://github.com/libgit2/objective-git/pull/464"},"issue":{"href":"https://api.github.com/repos/libgit2/objective-git/issues/464"},"comments":{"href":"https://api.github.com/repos/libgit2/objective-git/issues/464/comments"},"review_comments":{"href":"https://api.github.com/repos/libgit2/objective-git/pulls/464/comments"},"review_comment":{"href":"https://api.github.com/repos/libgit2/objective-git/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/libgit2/objective-git/pulls/464/commits"},"statuses":{"href":"https://api.github.com/repos/libgit2/objective-git/statuses/f7133265b42d844b5cbfca53b6aeb47f3908cac0"}}}}