{"action":"created","comment":{"url":"https://api.github.com/repos/18F/pages-server/pulls/comments/51925497","id":51925497,"diff_hunk":"@@ -0,0 +1,50 @@\n+'use strict';\n+\n+var fs = require('fs');\n+\n+module.exports = GitRunner;\n+\n+function GitRunner(config, builderOpts, commandRunner, logger) {\n+  this.git = config.git;\n+  this.githubOrg = builderOpts.githubOrg;\n+  this.repoDir = builderOpts.repoDir;\n+  this.sitePath = builderOpts.sitePath;\n+  this.commandRunner = commandRunner;\n+  this.logger = logger;\n+}\n+\n+GitRunner.prototype.prepareRepo = function(branch) {\n+  var gitRunner = this;\n+\n+  return new Promise(function(resolve) {\n+    fs.exists(gitRunner.sitePath, function(exists) {","path":"lib/git-runner.js","position":20,"original_position":20,"commit_id":"8d3e6a353ef8ce1507438417b88b57153867211c","original_commit_id":"8d3e6a353ef8ce1507438417b88b57153867211c","user":{"login":"msecret","id":1701077,"avatar_url":"https://avatars.githubusercontent.com/u/1701077?v=3","gravatar_id":"","url":"https://api.github.com/users/msecret","html_url":"https://github.com/msecret","followers_url":"https://api.github.com/users/msecret/followers","following_url":"https://api.github.com/users/msecret/following{/other_user}","gists_url":"https://api.github.com/users/msecret/gists{/gist_id}","starred_url":"https://api.github.com/users/msecret/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/msecret/subscriptions","organizations_url":"https://api.github.com/users/msecret/orgs","repos_url":"https://api.github.com/users/msecret/repos","events_url":"https://api.github.com/users/msecret/events{/privacy}","received_events_url":"https://api.github.com/users/msecret/received_events","type":"User","site_admin":false},"body":"What happen if it doesn't exist? There's no reject?","created_at":"2016-02-04T19:34:42Z","updated_at":"2016-02-04T19:34:42Z","html_url":"https://github.com/18F/pages-server/pull/35#discussion_r51925497","pull_request_url":"https://api.github.com/repos/18F/pages-server/pulls/35","_links":{"self":{"href":"https://api.github.com/repos/18F/pages-server/pulls/comments/51925497"},"html":{"href":"https://github.com/18F/pages-server/pull/35#discussion_r51925497"},"pull_request":{"href":"https://api.github.com/repos/18F/pages-server/pulls/35"}}},"pull_request":{"url":"https://api.github.com/repos/18F/pages-server/pulls/35","id":58192590,"html_url":"https://github.com/18F/pages-server/pull/35","diff_url":"https://github.com/18F/pages-server/pull/35.diff","patch_url":"https://github.com/18F/pages-server/pull/35.patch","issue_url":"https://api.github.com/repos/18F/pages-server/issues/35","number":35,"state":"open","locked":false,"title":"Refactor rsync, buildJekyll; extract GitRunner","user":{"login":"mbland","id":301547,"avatar_url":"https://avatars.githubusercontent.com/u/301547?v=3","gravatar_id":"","url":"https://api.github.com/users/mbland","html_url":"https://github.com/mbland","followers_url":"https://api.github.com/users/mbland/followers","following_url":"https://api.github.com/users/mbland/following{/other_user}","gists_url":"https://api.github.com/users/mbland/gists{/gist_id}","starred_url":"https://api.github.com/users/mbland/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mbland/subscriptions","organizations_url":"https://api.github.com/users/mbland/orgs","repos_url":"https://api.github.com/users/mbland/repos","events_url":"https://api.github.com/users/mbland/events{/privacy}","received_events_url":"https://api.github.com/users/mbland/received_events","type":"User","site_admin":false},"body":"Also moves the generated config cleanup inside the function passed to `doLockedOperation`.\r\n\r\ncc: @msecret @rogeruiz ","created_at":"2016-02-03T20:05:31Z","updated_at":"2016-02-04T19:34:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"df581d3801309e09bc5c687d78702075369b5165","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/18F/pages-server/pulls/35/commits","review_comments_url":"https://api.github.com/repos/18F/pages-server/pulls/35/comments","review_comment_url":"https://api.github.com/repos/18F/pages-server/pulls/comments{/number}","comments_url":"https://api.github.com/repos/18F/pages-server/issues/35/comments","statuses_url":"https://api.github.com/repos/18F/pages-server/statuses/8d3e6a353ef8ce1507438417b88b57153867211c","head":{"label":"18F:git-runner","ref":"git-runner","sha":"8d3e6a353ef8ce1507438417b88b57153867211c","user":{"login":"18F","id":6233994,"avatar_url":"https://avatars.githubusercontent.com/u/6233994?v=3","gravatar_id":"","url":"https://api.github.com/users/18F","html_url":"https://github.com/18F","followers_url":"https://api.github.com/users/18F/followers","following_url":"https://api.github.com/users/18F/following{/other_user}","gists_url":"https://api.github.com/users/18F/gists{/gist_id}","starred_url":"https://api.github.com/users/18F/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/18F/subscriptions","organizations_url":"https://api.github.com/users/18F/orgs","repos_url":"https://api.github.com/users/18F/repos","events_url":"https://api.github.com/users/18F/events{/privacy}","received_events_url":"https://api.github.com/users/18F/received_events","type":"Organization","site_admin":false},"repo":{"id":43040536,"name":"pages-server","full_name":"18F/pages-server","owner":{"login":"18F","id":6233994,"avatar_url":"https://avatars.githubusercontent.com/u/6233994?v=3","gravatar_id":"","url":"https://api.github.com/users/18F","html_url":"https://github.com/18F","followers_url":"https://api.github.com/users/18F/followers","following_url":"https://api.github.com/users/18F/following{/other_user}","gists_url":"https://api.github.com/users/18F/gists{/gist_id}","starred_url":"https://api.github.com/users/18F/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/18F/subscriptions","organizations_url":"https://api.github.com/users/18F/orgs","repos_url":"https://api.github.com/users/18F/repos","events_url":"https://api.github.com/users/18F/events{/privacy}","received_events_url":"https://api.github.com/users/18F/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/18F/pages-server","description":"Static website publishing server for 18F Pages","fork":false,"url":"https://api.github.com/repos/18F/pages-server","forks_url":"https://api.github.com/repos/18F/pages-server/forks","keys_url":"https://api.github.com/repos/18F/pages-server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/18F/pages-server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/18F/pages-server/teams","hooks_url":"https://api.github.com/repos/18F/pages-server/hooks","issue_events_url":"https://api.github.com/repos/18F/pages-server/issues/events{/number}","events_url":"https://api.github.com/repos/18F/pages-server/events","assignees_url":"https://api.github.com/repos/18F/pages-server/assignees{/user}","branches_url":"https://api.github.com/repos/18F/pages-server/branches{/branch}","tags_url":"https://api.github.com/repos/18F/pages-server/tags","blobs_url":"https://api.github.com/repos/18F/pages-server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/18F/pages-server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/18F/pages-server/git/refs{/sha}","trees_url":"https://api.github.com/repos/18F/pages-server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/18F/pages-server/statuses/{sha}","languages_url":"https://api.github.com/repos/18F/pages-server/languages","stargazers_url":"https://api.github.com/repos/18F/pages-server/stargazers","contributors_url":"https://api.github.com/repos/18F/pages-server/contributors","subscribers_url":"https://api.github.com/repos/18F/pages-server/subscribers","subscription_url":"https://api.github.com/repos/18F/pages-server/subscription","commits_url":"https://api.github.com/repos/18F/pages-server/commits{/sha}","git_commits_url":"https://api.github.com/repos/18F/pages-server/git/commits{/sha}","comments_url":"https://api.github.com/repos/18F/pages-server/comments{/number}","issue_comment_url":"https://api.github.com/repos/18F/pages-server/issues/comments{/number}","contents_url":"https://api.github.com/repos/18F/pages-server/contents/{+path}","compare_url":"https://api.github.com/repos/18F/pages-server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/18F/pages-server/merges","archive_url":"https://api.github.com/repos/18F/pages-server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/18F/pages-server/downloads","issues_url":"https://api.github.com/repos/18F/pages-server/issues{/number}","pulls_url":"https://api.github.com/repos/18F/pages-server/pulls{/number}","milestones_url":"https://api.github.com/repos/18F/pages-server/milestones{/number}","notifications_url":"https://api.github.com/repos/18F/pages-server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/18F/pages-server/labels{/name}","releases_url":"https://api.github.com/repos/18F/pages-server/releases{/id}","deployments_url":"https://api.github.com/repos/18F/pages-server/deployments","created_at":"2015-09-24T02:42:21Z","updated_at":"2016-01-21T21:10:03Z","pushed_at":"2016-02-04T18:05:16Z","git_url":"git://github.com/18F/pages-server.git","ssh_url":"git@github.com:18F/pages-server.git","clone_url":"https://github.com/18F/pages-server.git","svn_url":"https://github.com/18F/pages-server","homepage":"https://www.npmjs.com/package/18f-pages-server","size":167,"stargazers_count":6,"watchers_count":6,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":6,"forks":2,"open_issues":6,"watchers":6,"default_branch":"master"}},"base":{"label":"18F:master","ref":"master","sha":"36f3ccc1d9b503511444c4d5bbb375bca8467094","user":{"login":"18F","id":6233994,"avatar_url":"https://avatars.githubusercontent.com/u/6233994?v=3","gravatar_id":"","url":"https://api.github.com/users/18F","html_url":"https://github.com/18F","followers_url":"https://api.github.com/users/18F/followers","following_url":"https://api.github.com/users/18F/following{/other_user}","gists_url":"https://api.github.com/users/18F/gists{/gist_id}","starred_url":"https://api.github.com/users/18F/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/18F/subscriptions","organizations_url":"https://api.github.com/users/18F/orgs","repos_url":"https://api.github.com/users/18F/repos","events_url":"https://api.github.com/users/18F/events{/privacy}","received_events_url":"https://api.github.com/users/18F/received_events","type":"Organization","site_admin":false},"repo":{"id":43040536,"name":"pages-server","full_name":"18F/pages-server","owner":{"login":"18F","id":6233994,"avatar_url":"https://avatars.githubusercontent.com/u/6233994?v=3","gravatar_id":"","url":"https://api.github.com/users/18F","html_url":"https://github.com/18F","followers_url":"https://api.github.com/users/18F/followers","following_url":"https://api.github.com/users/18F/following{/other_user}","gists_url":"https://api.github.com/users/18F/gists{/gist_id}","starred_url":"https://api.github.com/users/18F/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/18F/subscriptions","organizations_url":"https://api.github.com/users/18F/orgs","repos_url":"https://api.github.com/users/18F/repos","events_url":"https://api.github.com/users/18F/events{/privacy}","received_events_url":"https://api.github.com/users/18F/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/18F/pages-server","description":"Static website publishing server for 18F Pages","fork":false,"url":"https://api.github.com/repos/18F/pages-server","forks_url":"https://api.github.com/repos/18F/pages-server/forks","keys_url":"https://api.github.com/repos/18F/pages-server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/18F/pages-server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/18F/pages-server/teams","hooks_url":"https://api.github.com/repos/18F/pages-server/hooks","issue_events_url":"https://api.github.com/repos/18F/pages-server/issues/events{/number}","events_url":"https://api.github.com/repos/18F/pages-server/events","assignees_url":"https://api.github.com/repos/18F/pages-server/assignees{/user}","branches_url":"https://api.github.com/repos/18F/pages-server/branches{/branch}","tags_url":"https://api.github.com/repos/18F/pages-server/tags","blobs_url":"https://api.github.com/repos/18F/pages-server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/18F/pages-server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/18F/pages-server/git/refs{/sha}","trees_url":"https://api.github.com/repos/18F/pages-server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/18F/pages-server/statuses/{sha}","languages_url":"https://api.github.com/repos/18F/pages-server/languages","stargazers_url":"https://api.github.com/repos/18F/pages-server/stargazers","contributors_url":"https://api.github.com/repos/18F/pages-server/contributors","subscribers_url":"https://api.github.com/repos/18F/pages-server/subscribers","subscription_url":"https://api.github.com/repos/18F/pages-server/subscription","commits_url":"https://api.github.com/repos/18F/pages-server/commits{/sha}","git_commits_url":"https://api.github.com/repos/18F/pages-server/git/commits{/sha}","comments_url":"https://api.github.com/repos/18F/pages-server/comments{/number}","issue_comment_url":"https://api.github.com/repos/18F/pages-server/issues/comments{/number}","contents_url":"https://api.github.com/repos/18F/pages-server/contents/{+path}","compare_url":"https://api.github.com/repos/18F/pages-server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/18F/pages-server/merges","archive_url":"https://api.github.com/repos/18F/pages-server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/18F/pages-server/downloads","issues_url":"https://api.github.com/repos/18F/pages-server/issues{/number}","pulls_url":"https://api.github.com/repos/18F/pages-server/pulls{/number}","milestones_url":"https://api.github.com/repos/18F/pages-server/milestones{/number}","notifications_url":"https://api.github.com/repos/18F/pages-server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/18F/pages-server/labels{/name}","releases_url":"https://api.github.com/repos/18F/pages-server/releases{/id}","deployments_url":"https://api.github.com/repos/18F/pages-server/deployments","created_at":"2015-09-24T02:42:21Z","updated_at":"2016-01-21T21:10:03Z","pushed_at":"2016-02-04T18:05:16Z","git_url":"git://github.com/18F/pages-server.git","ssh_url":"git@github.com:18F/pages-server.git","clone_url":"https://github.com/18F/pages-server.git","svn_url":"https://github.com/18F/pages-server","homepage":"https://www.npmjs.com/package/18f-pages-server","size":167,"stargazers_count":6,"watchers_count":6,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":6,"forks":2,"open_issues":6,"watchers":6,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/18F/pages-server/pulls/35"},"html":{"href":"https://github.com/18F/pages-server/pull/35"},"issue":{"href":"https://api.github.com/repos/18F/pages-server/issues/35"},"comments":{"href":"https://api.github.com/repos/18F/pages-server/issues/35/comments"},"review_comments":{"href":"https://api.github.com/repos/18F/pages-server/pulls/35/comments"},"review_comment":{"href":"https://api.github.com/repos/18F/pages-server/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/18F/pages-server/pulls/35/commits"},"statuses":{"href":"https://api.github.com/repos/18F/pages-server/statuses/8d3e6a353ef8ce1507438417b88b57153867211c"}}}}