{"action":"created","comment":{"url":"https://api.github.com/repos/fastlane/fastlane/pulls/comments/62444751","id":62444751,"diff_hunk":"@@ -48,25 +46,19 @@ def self.match_version(workspace)\n     end\n \n     def self.commit_changes(path, message, git_url)\n-      Dir.chdir(path) do\n-        return if `git status`.include?(\"nothing to commit\")\n+      git = Git.open(path)\n \n-        Encrypt.new.encrypt_repo(path: path, git_url: git_url)\n-        File.write(\"match_version.txt\", Match::VERSION) # unencrypted\n+      # Avoid calling git.status if no branch exists\n+      return unless git.current_branch.nil? or git.status.any?","path":"match/lib/match/git_helper.rb","position":28,"original_position":28,"commit_id":"1370b3050304b7f69ad811538f80238e8f36854a","original_commit_id":"1370b3050304b7f69ad811538f80238e8f36854a","user":{"login":"tobiasstrebitzer","id":222509,"avatar_url":"https://avatars.githubusercontent.com/u/222509?v=3","gravatar_id":"","url":"https://api.github.com/users/tobiasstrebitzer","html_url":"https://github.com/tobiasstrebitzer","followers_url":"https://api.github.com/users/tobiasstrebitzer/followers","following_url":"https://api.github.com/users/tobiasstrebitzer/following{/other_user}","gists_url":"https://api.github.com/users/tobiasstrebitzer/gists{/gist_id}","starred_url":"https://api.github.com/users/tobiasstrebitzer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tobiasstrebitzer/subscriptions","organizations_url":"https://api.github.com/users/tobiasstrebitzer/orgs","repos_url":"https://api.github.com/users/tobiasstrebitzer/repos","events_url":"https://api.github.com/users/tobiasstrebitzer/events{/privacy}","received_events_url":"https://api.github.com/users/tobiasstrebitzer/received_events","type":"User","site_admin":false},"body":"I'm checking whether git has a current_branch registered or not. Will receive the name of the branch if a commit has been made before, or nil if it's a newly created branch. The reason i'm doing this is because calling git.status on a new branch (without any commits) throws an error (due to a bug in ruby-git).","created_at":"2016-05-09T02:23:03Z","updated_at":"2016-05-09T02:23:03Z","html_url":"https://github.com/fastlane/fastlane/pull/4517#discussion_r62444751","pull_request_url":"https://api.github.com/repos/fastlane/fastlane/pulls/4517","_links":{"self":{"href":"https://api.github.com/repos/fastlane/fastlane/pulls/comments/62444751"},"html":{"href":"https://github.com/fastlane/fastlane/pull/4517#discussion_r62444751"},"pull_request":{"href":"https://api.github.com/repos/fastlane/fastlane/pulls/4517"}}},"pull_request":{"url":"https://api.github.com/repos/fastlane/fastlane/pulls/4517","id":69002387,"html_url":"https://github.com/fastlane/fastlane/pull/4517","diff_url":"https://github.com/fastlane/fastlane/pull/4517.diff","patch_url":"https://github.com/fastlane/fastlane/pull/4517.patch","issue_url":"https://api.github.com/repos/fastlane/fastlane/issues/4517","number":4517,"state":"open","locked":false,"title":"Match: Implement ruby-git (gem) based repository management","user":{"login":"tobiasstrebitzer","id":222509,"avatar_url":"https://avatars.githubusercontent.com/u/222509?v=3","gravatar_id":"","url":"https://api.github.com/users/tobiasstrebitzer","html_url":"https://github.com/tobiasstrebitzer","followers_url":"https://api.github.com/users/tobiasstrebitzer/followers","following_url":"https://api.github.com/users/tobiasstrebitzer/following{/other_user}","gists_url":"https://api.github.com/users/tobiasstrebitzer/gists{/gist_id}","starred_url":"https://api.github.com/users/tobiasstrebitzer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tobiasstrebitzer/subscriptions","organizations_url":"https://api.github.com/users/tobiasstrebitzer/orgs","repos_url":"https://api.github.com/users/tobiasstrebitzer/repos","events_url":"https://api.github.com/users/tobiasstrebitzer/events{/privacy}","received_events_url":"https://api.github.com/users/tobiasstrebitzer/received_events","type":"User","site_admin":false},"body":"# Problem\r\n* At the moment, all git- related functionality for synchronizing certificates inside the match gem is run via system calls (FastlaneCore::CommandExecutor).\r\n* While that works, it might be hard to maintain: Parsing of git cli responses and error handling need to be maintained and it might be hard make (and keep) it reliable, especially if new functionality is required (e.g. branch management, reverting, handling merge conflicts, etc...).\r\n\r\n# Solution\r\n* This PR replaces all current git- command invocations with functionality provided by the ruby-git gem.\r\n* [Ruby/Git](https://github.com/schacon/ruby-git) is a Ruby library that can be used to create, read and manipulate Git repositories by wrapping system calls to the git binary.\r\n\r\n# Downsides / Limitations\r\n* ~~There is currently a bug (or rather limitation) where the git.status command will return an exception if run against an empty git repository without previous commits: https://github.com/schacon/ruby-git/issues/275. This can be overcome by either (1) patching this limitation in the ruby-git gem, (2) making sure git status is only called after at lease one commit was made, or (3) catching and handling the exception thrown by git-ruby.~~ fixed in https://github.com/fastlane/fastlane/pull/4517/commits/1370b3050304b7f69ad811538f80238e8f36854a \r\n* The latest commit in ruby-git was made on Feb 26 2016 (although i personally found this gem very reliable in the past, also considering that core git functionality is unlikely to change).","created_at":"2016-05-05T12:48:54Z","updated_at":"2016-05-09T02:23:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c2b76cde4f9e2962c6b695074b81ad60593bc1ab","assignee":{"login":"KrauseFx","id":869950,"avatar_url":"https://avatars.githubusercontent.com/u/869950?v=3","gravatar_id":"","url":"https://api.github.com/users/KrauseFx","html_url":"https://github.com/KrauseFx","followers_url":"https://api.github.com/users/KrauseFx/followers","following_url":"https://api.github.com/users/KrauseFx/following{/other_user}","gists_url":"https://api.github.com/users/KrauseFx/gists{/gist_id}","starred_url":"https://api.github.com/users/KrauseFx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KrauseFx/subscriptions","organizations_url":"https://api.github.com/users/KrauseFx/orgs","repos_url":"https://api.github.com/users/KrauseFx/repos","events_url":"https://api.github.com/users/KrauseFx/events{/privacy}","received_events_url":"https://api.github.com/users/KrauseFx/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/fastlane/fastlane/pulls/4517/commits","review_comments_url":"https://api.github.com/repos/fastlane/fastlane/pulls/4517/comments","review_comment_url":"https://api.github.com/repos/fastlane/fastlane/pulls/comments{/number}","comments_url":"https://api.github.com/repos/fastlane/fastlane/issues/4517/comments","statuses_url":"https://api.github.com/repos/fastlane/fastlane/statuses/1370b3050304b7f69ad811538f80238e8f36854a","head":{"label":"MagLoft:feature-match-git-gem","ref":"feature-match-git-gem","sha":"1370b3050304b7f69ad811538f80238e8f36854a","user":{"login":"MagLoft","id":9048323,"avatar_url":"https://avatars.githubusercontent.com/u/9048323?v=3","gravatar_id":"","url":"https://api.github.com/users/MagLoft","html_url":"https://github.com/MagLoft","followers_url":"https://api.github.com/users/MagLoft/followers","following_url":"https://api.github.com/users/MagLoft/following{/other_user}","gists_url":"https://api.github.com/users/MagLoft/gists{/gist_id}","starred_url":"https://api.github.com/users/MagLoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MagLoft/subscriptions","organizations_url":"https://api.github.com/users/MagLoft/orgs","repos_url":"https://api.github.com/users/MagLoft/repos","events_url":"https://api.github.com/users/MagLoft/events{/privacy}","received_events_url":"https://api.github.com/users/MagLoft/received_events","type":"Organization","site_admin":false},"repo":{"id":58029204,"name":"fastlane","full_name":"MagLoft/fastlane","owner":{"login":"MagLoft","id":9048323,"avatar_url":"https://avatars.githubusercontent.com/u/9048323?v=3","gravatar_id":"","url":"https://api.github.com/users/MagLoft","html_url":"https://github.com/MagLoft","followers_url":"https://api.github.com/users/MagLoft/followers","following_url":"https://api.github.com/users/MagLoft/following{/other_user}","gists_url":"https://api.github.com/users/MagLoft/gists{/gist_id}","starred_url":"https://api.github.com/users/MagLoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MagLoft/subscriptions","organizations_url":"https://api.github.com/users/MagLoft/orgs","repos_url":"https://api.github.com/users/MagLoft/repos","events_url":"https://api.github.com/users/MagLoft/events{/privacy}","received_events_url":"https://api.github.com/users/MagLoft/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/MagLoft/fastlane","description":"The easiest way to automate building and releasing your iOS and Android apps","fork":true,"url":"https://api.github.com/repos/MagLoft/fastlane","forks_url":"https://api.github.com/repos/MagLoft/fastlane/forks","keys_url":"https://api.github.com/repos/MagLoft/fastlane/keys{/key_id}","collaborators_url":"https://api.github.com/repos/MagLoft/fastlane/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/MagLoft/fastlane/teams","hooks_url":"https://api.github.com/repos/MagLoft/fastlane/hooks","issue_events_url":"https://api.github.com/repos/MagLoft/fastlane/issues/events{/number}","events_url":"https://api.github.com/repos/MagLoft/fastlane/events","assignees_url":"https://api.github.com/repos/MagLoft/fastlane/assignees{/user}","branches_url":"https://api.github.com/repos/MagLoft/fastlane/branches{/branch}","tags_url":"https://api.github.com/repos/MagLoft/fastlane/tags","blobs_url":"https://api.github.com/repos/MagLoft/fastlane/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/MagLoft/fastlane/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/MagLoft/fastlane/git/refs{/sha}","trees_url":"https://api.github.com/repos/MagLoft/fastlane/git/trees{/sha}","statuses_url":"https://api.github.com/repos/MagLoft/fastlane/statuses/{sha}","languages_url":"https://api.github.com/repos/MagLoft/fastlane/languages","stargazers_url":"https://api.github.com/repos/MagLoft/fastlane/stargazers","contributors_url":"https://api.github.com/repos/MagLoft/fastlane/contributors","subscribers_url":"https://api.github.com/repos/MagLoft/fastlane/subscribers","subscription_url":"https://api.github.com/repos/MagLoft/fastlane/subscription","commits_url":"https://api.github.com/repos/MagLoft/fastlane/commits{/sha}","git_commits_url":"https://api.github.com/repos/MagLoft/fastlane/git/commits{/sha}","comments_url":"https://api.github.com/repos/MagLoft/fastlane/comments{/number}","issue_comment_url":"https://api.github.com/repos/MagLoft/fastlane/issues/comments{/number}","contents_url":"https://api.github.com/repos/MagLoft/fastlane/contents/{+path}","compare_url":"https://api.github.com/repos/MagLoft/fastlane/compare/{base}...{head}","merges_url":"https://api.github.com/repos/MagLoft/fastlane/merges","archive_url":"https://api.github.com/repos/MagLoft/fastlane/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/MagLoft/fastlane/downloads","issues_url":"https://api.github.com/repos/MagLoft/fastlane/issues{/number}","pulls_url":"https://api.github.com/repos/MagLoft/fastlane/pulls{/number}","milestones_url":"https://api.github.com/repos/MagLoft/fastlane/milestones{/number}","notifications_url":"https://api.github.com/repos/MagLoft/fastlane/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/MagLoft/fastlane/labels{/name}","releases_url":"https://api.github.com/repos/MagLoft/fastlane/releases{/id}","deployments_url":"https://api.github.com/repos/MagLoft/fastlane/deployments","created_at":"2016-05-04T06:44:19Z","updated_at":"2016-05-04T06:44:23Z","pushed_at":"2016-05-05T15:56:43Z","git_url":"git://github.com/MagLoft/fastlane.git","ssh_url":"git@github.com:MagLoft/fastlane.git","clone_url":"https://github.com/MagLoft/fastlane.git","svn_url":"https://github.com/MagLoft/fastlane","homepage":"https://fastlane.tools","size":49669,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"fastlane:master","ref":"master","sha":"70a5b270a6cf109acc967817a3144dc2f09ae812","user":{"login":"fastlane","id":11098337,"avatar_url":"https://avatars.githubusercontent.com/u/11098337?v=3","gravatar_id":"","url":"https://api.github.com/users/fastlane","html_url":"https://github.com/fastlane","followers_url":"https://api.github.com/users/fastlane/followers","following_url":"https://api.github.com/users/fastlane/following{/other_user}","gists_url":"https://api.github.com/users/fastlane/gists{/gist_id}","starred_url":"https://api.github.com/users/fastlane/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fastlane/subscriptions","organizations_url":"https://api.github.com/users/fastlane/orgs","repos_url":"https://api.github.com/users/fastlane/repos","events_url":"https://api.github.com/users/fastlane/events{/privacy}","received_events_url":"https://api.github.com/users/fastlane/received_events","type":"Organization","site_admin":false},"repo":{"id":27442967,"name":"fastlane","full_name":"fastlane/fastlane","owner":{"login":"fastlane","id":11098337,"avatar_url":"https://avatars.githubusercontent.com/u/11098337?v=3","gravatar_id":"","url":"https://api.github.com/users/fastlane","html_url":"https://github.com/fastlane","followers_url":"https://api.github.com/users/fastlane/followers","following_url":"https://api.github.com/users/fastlane/following{/other_user}","gists_url":"https://api.github.com/users/fastlane/gists{/gist_id}","starred_url":"https://api.github.com/users/fastlane/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fastlane/subscriptions","organizations_url":"https://api.github.com/users/fastlane/orgs","repos_url":"https://api.github.com/users/fastlane/repos","events_url":"https://api.github.com/users/fastlane/events{/privacy}","received_events_url":"https://api.github.com/users/fastlane/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/fastlane/fastlane","description":"The easiest way to automate building and releasing your iOS and Android apps","fork":false,"url":"https://api.github.com/repos/fastlane/fastlane","forks_url":"https://api.github.com/repos/fastlane/fastlane/forks","keys_url":"https://api.github.com/repos/fastlane/fastlane/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fastlane/fastlane/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fastlane/fastlane/teams","hooks_url":"https://api.github.com/repos/fastlane/fastlane/hooks","issue_events_url":"https://api.github.com/repos/fastlane/fastlane/issues/events{/number}","events_url":"https://api.github.com/repos/fastlane/fastlane/events","assignees_url":"https://api.github.com/repos/fastlane/fastlane/assignees{/user}","branches_url":"https://api.github.com/repos/fastlane/fastlane/branches{/branch}","tags_url":"https://api.github.com/repos/fastlane/fastlane/tags","blobs_url":"https://api.github.com/repos/fastlane/fastlane/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fastlane/fastlane/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fastlane/fastlane/git/refs{/sha}","trees_url":"https://api.github.com/repos/fastlane/fastlane/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fastlane/fastlane/statuses/{sha}","languages_url":"https://api.github.com/repos/fastlane/fastlane/languages","stargazers_url":"https://api.github.com/repos/fastlane/fastlane/stargazers","contributors_url":"https://api.github.com/repos/fastlane/fastlane/contributors","subscribers_url":"https://api.github.com/repos/fastlane/fastlane/subscribers","subscription_url":"https://api.github.com/repos/fastlane/fastlane/subscription","commits_url":"https://api.github.com/repos/fastlane/fastlane/commits{/sha}","git_commits_url":"https://api.github.com/repos/fastlane/fastlane/git/commits{/sha}","comments_url":"https://api.github.com/repos/fastlane/fastlane/comments{/number}","issue_comment_url":"https://api.github.com/repos/fastlane/fastlane/issues/comments{/number}","contents_url":"https://api.github.com/repos/fastlane/fastlane/contents/{+path}","compare_url":"https://api.github.com/repos/fastlane/fastlane/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fastlane/fastlane/merges","archive_url":"https://api.github.com/repos/fastlane/fastlane/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fastlane/fastlane/downloads","issues_url":"https://api.github.com/repos/fastlane/fastlane/issues{/number}","pulls_url":"https://api.github.com/repos/fastlane/fastlane/pulls{/number}","milestones_url":"https://api.github.com/repos/fastlane/fastlane/milestones{/number}","notifications_url":"https://api.github.com/repos/fastlane/fastlane/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fastlane/fastlane/labels{/name}","releases_url":"https://api.github.com/repos/fastlane/fastlane/releases{/id}","deployments_url":"https://api.github.com/repos/fastlane/fastlane/deployments","created_at":"2014-12-02T17:00:38Z","updated_at":"2016-05-09T01:20:51Z","pushed_at":"2016-05-08T22:44:34Z","git_url":"git://github.com/fastlane/fastlane.git","ssh_url":"git@github.com:fastlane/fastlane.git","clone_url":"https://github.com/fastlane/fastlane.git","svn_url":"https://github.com/fastlane/fastlane","homepage":"https://fastlane.tools","size":57464,"stargazers_count":7628,"watchers_count":7628,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1011,"mirror_url":null,"open_issues_count":740,"forks":1011,"open_issues":740,"watchers":7628,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/fastlane/fastlane/pulls/4517"},"html":{"href":"https://github.com/fastlane/fastlane/pull/4517"},"issue":{"href":"https://api.github.com/repos/fastlane/fastlane/issues/4517"},"comments":{"href":"https://api.github.com/repos/fastlane/fastlane/issues/4517/comments"},"review_comments":{"href":"https://api.github.com/repos/fastlane/fastlane/pulls/4517/comments"},"review_comment":{"href":"https://api.github.com/repos/fastlane/fastlane/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/fastlane/fastlane/pulls/4517/commits"},"statuses":{"href":"https://api.github.com/repos/fastlane/fastlane/statuses/1370b3050304b7f69ad811538f80238e8f36854a"}}}}