{"action":"created","comment":{"url":"https://api.github.com/repos/baydindima/JavaCourse/pulls/comments/84595332","pull_request_review_id":5364331,"id":84595332,"diff_hunk":"@@ -0,0 +1,66 @@\n+package homework2.command.impl;\n+\n+import homework2.app.VersionControlSystem;\n+import homework2.command.Command;\n+import homework2.model.Commit;\n+import homework2.model.FileInfo;\n+\n+import java.io.File;\n+import java.nio.file.Path;\n+import java.util.HashSet;\n+import java.util.List;\n+import java.util.Map;\n+import java.util.Set;\n+\n+/**\n+ * @author Dmitriy Baidin on 10/4/2016.\n+ */\n+public class StatusCommand implements Command {\n+\n+    @Override\n+    public String execute(VersionControlSystem versionControlSystem, String[] args) {\n+        versionControlSystem.getRepositoryLoader().checkRepositoryInit();\n+\n+        Map<FileInfo, Commit> fileInfoCommitMap = versionControlSystem.getCommitTreeCrawler()\n+                .collectFiles(versionControlSystem.getRepository());\n+\n+        Set<FileInfo> changedFiles = new HashSet<>();\n+        Set<FileInfo> removedFiles = new HashSet<>();\n+\n+        Path currentDirPath = versionControlSystem.getFileSystem().getCurrentDirPath();\n+        for (FileInfo fileInfo : fileInfoCommitMap.keySet()) {\n+            File file = new File(currentDirPath.toFile(), fileInfo.getPath());\n+            if (file.exists()) {\n+                if (file.lastModified() > fileInfo.getLastUpdated()) {\n+                    changedFiles.add(new FileInfo(fileInfo.getPath(), file.lastModified()));\n+                }\n+            } else {\n+                removedFiles.add(fileInfo);\n+            }\n+        }\n+\n+        List<String> addedFiles = versionControlSystem.getAddedFilesManager().getAddedFiles();\n+\n+        if (changedFiles.size() > 0) {","path":"src/main/java/homework2/command/impl/StatusCommand.java","position":44,"original_position":44,"commit_id":"4ac9cdac98b04108bf6ac7649a48f7ecb9ff022b","original_commit_id":"4ac9cdac98b04108bf6ac7649a48f7ecb9ff022b","user":{"login":"jzuken","id":705678,"avatar_url":"https://avatars.githubusercontent.com/u/705678?v=3","gravatar_id":"","url":"https://api.github.com/users/jzuken","html_url":"https://github.com/jzuken","followers_url":"https://api.github.com/users/jzuken/followers","following_url":"https://api.github.com/users/jzuken/following{/other_user}","gists_url":"https://api.github.com/users/jzuken/gists{/gist_id}","starred_url":"https://api.github.com/users/jzuken/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jzuken/subscriptions","organizations_url":"https://api.github.com/users/jzuken/orgs","repos_url":"https://api.github.com/users/jzuken/repos","events_url":"https://api.github.com/users/jzuken/events{/privacy}","received_events_url":"https://api.github.com/users/jzuken/received_events","type":"User","site_admin":false},"body":"вот эти кусочки кода прям просятся в отдельные функции","created_at":"2016-10-23T12:34:16Z","updated_at":"2016-10-23T12:35:25Z","html_url":"https://github.com/baydindima/JavaCourse/pull/3#discussion_r84595332","pull_request_url":"https://api.github.com/repos/baydindima/JavaCourse/pulls/3","_links":{"self":{"href":"https://api.github.com/repos/baydindima/JavaCourse/pulls/comments/84595332"},"html":{"href":"https://github.com/baydindima/JavaCourse/pull/3#discussion_r84595332"},"pull_request":{"href":"https://api.github.com/repos/baydindima/JavaCourse/pulls/3"}}},"pull_request":{"url":"https://api.github.com/repos/baydindima/JavaCourse/pulls/3","id":86631433,"html_url":"https://github.com/baydindima/JavaCourse/pull/3","diff_url":"https://github.com/baydindima/JavaCourse/pull/3.diff","patch_url":"https://github.com/baydindima/JavaCourse/pull/3.patch","issue_url":"https://api.github.com/repos/baydindima/JavaCourse/issues/3","number":3,"state":"open","locked":false,"title":"Vcs homework 2","user":{"login":"baydindima","id":14199087,"avatar_url":"https://avatars.githubusercontent.com/u/14199087?v=3","gravatar_id":"","url":"https://api.github.com/users/baydindima","html_url":"https://github.com/baydindima","followers_url":"https://api.github.com/users/baydindima/followers","following_url":"https://api.github.com/users/baydindima/following{/other_user}","gists_url":"https://api.github.com/users/baydindima/gists{/gist_id}","starred_url":"https://api.github.com/users/baydindima/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/baydindima/subscriptions","organizations_url":"https://api.github.com/users/baydindima/orgs","repos_url":"https://api.github.com/users/baydindima/repos","events_url":"https://api.github.com/users/baydindima/events{/privacy}","received_events_url":"https://api.github.com/users/baydindima/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-09-24T21:36:19Z","updated_at":"2016-10-23T12:35:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"380bc8bf5d0ece6e0fefd661dc06fe87fb13a9b1","assignee":{"login":"jzuken","id":705678,"avatar_url":"https://avatars.githubusercontent.com/u/705678?v=3","gravatar_id":"","url":"https://api.github.com/users/jzuken","html_url":"https://github.com/jzuken","followers_url":"https://api.github.com/users/jzuken/followers","following_url":"https://api.github.com/users/jzuken/following{/other_user}","gists_url":"https://api.github.com/users/jzuken/gists{/gist_id}","starred_url":"https://api.github.com/users/jzuken/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jzuken/subscriptions","organizations_url":"https://api.github.com/users/jzuken/orgs","repos_url":"https://api.github.com/users/jzuken/repos","events_url":"https://api.github.com/users/jzuken/events{/privacy}","received_events_url":"https://api.github.com/users/jzuken/received_events","type":"User","site_admin":false},"assignees":[{"login":"jzuken","id":705678,"avatar_url":"https://avatars.githubusercontent.com/u/705678?v=3","gravatar_id":"","url":"https://api.github.com/users/jzuken","html_url":"https://github.com/jzuken","followers_url":"https://api.github.com/users/jzuken/followers","following_url":"https://api.github.com/users/jzuken/following{/other_user}","gists_url":"https://api.github.com/users/jzuken/gists{/gist_id}","starred_url":"https://api.github.com/users/jzuken/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jzuken/subscriptions","organizations_url":"https://api.github.com/users/jzuken/orgs","repos_url":"https://api.github.com/users/jzuken/repos","events_url":"https://api.github.com/users/jzuken/events{/privacy}","received_events_url":"https://api.github.com/users/jzuken/received_events","type":"User","site_admin":false},{"login":"baydindima","id":14199087,"avatar_url":"https://avatars.githubusercontent.com/u/14199087?v=3","gravatar_id":"","url":"https://api.github.com/users/baydindima","html_url":"https://github.com/baydindima","followers_url":"https://api.github.com/users/baydindima/followers","following_url":"https://api.github.com/users/baydindima/following{/other_user}","gists_url":"https://api.github.com/users/baydindima/gists{/gist_id}","starred_url":"https://api.github.com/users/baydindima/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/baydindima/subscriptions","organizations_url":"https://api.github.com/users/baydindima/orgs","repos_url":"https://api.github.com/users/baydindima/repos","events_url":"https://api.github.com/users/baydindima/events{/privacy}","received_events_url":"https://api.github.com/users/baydindima/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/baydindima/JavaCourse/pulls/3/commits","review_comments_url":"https://api.github.com/repos/baydindima/JavaCourse/pulls/3/comments","review_comment_url":"https://api.github.com/repos/baydindima/JavaCourse/pulls/comments{/number}","comments_url":"https://api.github.com/repos/baydindima/JavaCourse/issues/3/comments","statuses_url":"https://api.github.com/repos/baydindima/JavaCourse/statuses/4ac9cdac98b04108bf6ac7649a48f7ecb9ff022b","head":{"label":"baydindima:vcs-homework-2","ref":"vcs-homework-2","sha":"4ac9cdac98b04108bf6ac7649a48f7ecb9ff022b","user":{"login":"baydindima","id":14199087,"avatar_url":"https://avatars.githubusercontent.com/u/14199087?v=3","gravatar_id":"","url":"https://api.github.com/users/baydindima","html_url":"https://github.com/baydindima","followers_url":"https://api.github.com/users/baydindima/followers","following_url":"https://api.github.com/users/baydindima/following{/other_user}","gists_url":"https://api.github.com/users/baydindima/gists{/gist_id}","starred_url":"https://api.github.com/users/baydindima/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/baydindima/subscriptions","organizations_url":"https://api.github.com/users/baydindima/orgs","repos_url":"https://api.github.com/users/baydindima/repos","events_url":"https://api.github.com/users/baydindima/events{/privacy}","received_events_url":"https://api.github.com/users/baydindima/received_events","type":"User","site_admin":false},"repo":{"id":67916347,"name":"JavaCourse","full_name":"baydindima/JavaCourse","owner":{"login":"baydindima","id":14199087,"avatar_url":"https://avatars.githubusercontent.com/u/14199087?v=3","gravatar_id":"","url":"https://api.github.com/users/baydindima","html_url":"https://github.com/baydindima","followers_url":"https://api.github.com/users/baydindima/followers","following_url":"https://api.github.com/users/baydindima/following{/other_user}","gists_url":"https://api.github.com/users/baydindima/gists{/gist_id}","starred_url":"https://api.github.com/users/baydindima/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/baydindima/subscriptions","organizations_url":"https://api.github.com/users/baydindima/orgs","repos_url":"https://api.github.com/users/baydindima/repos","events_url":"https://api.github.com/users/baydindima/events{/privacy}","received_events_url":"https://api.github.com/users/baydindima/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/baydindima/JavaCourse","description":"Master Java-II course. Autumn 2016.","fork":false,"url":"https://api.github.com/repos/baydindima/JavaCourse","forks_url":"https://api.github.com/repos/baydindima/JavaCourse/forks","keys_url":"https://api.github.com/repos/baydindima/JavaCourse/keys{/key_id}","collaborators_url":"https://api.github.com/repos/baydindima/JavaCourse/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/baydindima/JavaCourse/teams","hooks_url":"https://api.github.com/repos/baydindima/JavaCourse/hooks","issue_events_url":"https://api.github.com/repos/baydindima/JavaCourse/issues/events{/number}","events_url":"https://api.github.com/repos/baydindima/JavaCourse/events","assignees_url":"https://api.github.com/repos/baydindima/JavaCourse/assignees{/user}","branches_url":"https://api.github.com/repos/baydindima/JavaCourse/branches{/branch}","tags_url":"https://api.github.com/repos/baydindima/JavaCourse/tags","blobs_url":"https://api.github.com/repos/baydindima/JavaCourse/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/baydindima/JavaCourse/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/baydindima/JavaCourse/git/refs{/sha}","trees_url":"https://api.github.com/repos/baydindima/JavaCourse/git/trees{/sha}","statuses_url":"https://api.github.com/repos/baydindima/JavaCourse/statuses/{sha}","languages_url":"https://api.github.com/repos/baydindima/JavaCourse/languages","stargazers_url":"https://api.github.com/repos/baydindima/JavaCourse/stargazers","contributors_url":"https://api.github.com/repos/baydindima/JavaCourse/contributors","subscribers_url":"https://api.github.com/repos/baydindima/JavaCourse/subscribers","subscription_url":"https://api.github.com/repos/baydindima/JavaCourse/subscription","commits_url":"https://api.github.com/repos/baydindima/JavaCourse/commits{/sha}","git_commits_url":"https://api.github.com/repos/baydindima/JavaCourse/git/commits{/sha}","comments_url":"https://api.github.com/repos/baydindima/JavaCourse/comments{/number}","issue_comment_url":"https://api.github.com/repos/baydindima/JavaCourse/issues/comments{/number}","contents_url":"https://api.github.com/repos/baydindima/JavaCourse/contents/{+path}","compare_url":"https://api.github.com/repos/baydindima/JavaCourse/compare/{base}...{head}","merges_url":"https://api.github.com/repos/baydindima/JavaCourse/merges","archive_url":"https://api.github.com/repos/baydindima/JavaCourse/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/baydindima/JavaCourse/downloads","issues_url":"https://api.github.com/repos/baydindima/JavaCourse/issues{/number}","pulls_url":"https://api.github.com/repos/baydindima/JavaCourse/pulls{/number}","milestones_url":"https://api.github.com/repos/baydindima/JavaCourse/milestones{/number}","notifications_url":"https://api.github.com/repos/baydindima/JavaCourse/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/baydindima/JavaCourse/labels{/name}","releases_url":"https://api.github.com/repos/baydindima/JavaCourse/releases{/id}","deployments_url":"https://api.github.com/repos/baydindima/JavaCourse/deployments","created_at":"2016-09-11T07:25:16Z","updated_at":"2016-09-21T08:52:56Z","pushed_at":"2016-10-19T09:20:50Z","git_url":"git://github.com/baydindima/JavaCourse.git","ssh_url":"git@github.com:baydindima/JavaCourse.git","clone_url":"https://github.com/baydindima/JavaCourse.git","svn_url":"https://github.com/baydindima/JavaCourse","homepage":null,"size":94,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"base":{"label":"baydindima:master","ref":"master","sha":"88e4aeb0b426607aac8a689a8acdd838313d9126","user":{"login":"baydindima","id":14199087,"avatar_url":"https://avatars.githubusercontent.com/u/14199087?v=3","gravatar_id":"","url":"https://api.github.com/users/baydindima","html_url":"https://github.com/baydindima","followers_url":"https://api.github.com/users/baydindima/followers","following_url":"https://api.github.com/users/baydindima/following{/other_user}","gists_url":"https://api.github.com/users/baydindima/gists{/gist_id}","starred_url":"https://api.github.com/users/baydindima/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/baydindima/subscriptions","organizations_url":"https://api.github.com/users/baydindima/orgs","repos_url":"https://api.github.com/users/baydindima/repos","events_url":"https://api.github.com/users/baydindima/events{/privacy}","received_events_url":"https://api.github.com/users/baydindima/received_events","type":"User","site_admin":false},"repo":{"id":67916347,"name":"JavaCourse","full_name":"baydindima/JavaCourse","owner":{"login":"baydindima","id":14199087,"avatar_url":"https://avatars.githubusercontent.com/u/14199087?v=3","gravatar_id":"","url":"https://api.github.com/users/baydindima","html_url":"https://github.com/baydindima","followers_url":"https://api.github.com/users/baydindima/followers","following_url":"https://api.github.com/users/baydindima/following{/other_user}","gists_url":"https://api.github.com/users/baydindima/gists{/gist_id}","starred_url":"https://api.github.com/users/baydindima/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/baydindima/subscriptions","organizations_url":"https://api.github.com/users/baydindima/orgs","repos_url":"https://api.github.com/users/baydindima/repos","events_url":"https://api.github.com/users/baydindima/events{/privacy}","received_events_url":"https://api.github.com/users/baydindima/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/baydindima/JavaCourse","description":"Master Java-II course. Autumn 2016.","fork":false,"url":"https://api.github.com/repos/baydindima/JavaCourse","forks_url":"https://api.github.com/repos/baydindima/JavaCourse/forks","keys_url":"https://api.github.com/repos/baydindima/JavaCourse/keys{/key_id}","collaborators_url":"https://api.github.com/repos/baydindima/JavaCourse/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/baydindima/JavaCourse/teams","hooks_url":"https://api.github.com/repos/baydindima/JavaCourse/hooks","issue_events_url":"https://api.github.com/repos/baydindima/JavaCourse/issues/events{/number}","events_url":"https://api.github.com/repos/baydindima/JavaCourse/events","assignees_url":"https://api.github.com/repos/baydindima/JavaCourse/assignees{/user}","branches_url":"https://api.github.com/repos/baydindima/JavaCourse/branches{/branch}","tags_url":"https://api.github.com/repos/baydindima/JavaCourse/tags","blobs_url":"https://api.github.com/repos/baydindima/JavaCourse/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/baydindima/JavaCourse/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/baydindima/JavaCourse/git/refs{/sha}","trees_url":"https://api.github.com/repos/baydindima/JavaCourse/git/trees{/sha}","statuses_url":"https://api.github.com/repos/baydindima/JavaCourse/statuses/{sha}","languages_url":"https://api.github.com/repos/baydindima/JavaCourse/languages","stargazers_url":"https://api.github.com/repos/baydindima/JavaCourse/stargazers","contributors_url":"https://api.github.com/repos/baydindima/JavaCourse/contributors","subscribers_url":"https://api.github.com/repos/baydindima/JavaCourse/subscribers","subscription_url":"https://api.github.com/repos/baydindima/JavaCourse/subscription","commits_url":"https://api.github.com/repos/baydindima/JavaCourse/commits{/sha}","git_commits_url":"https://api.github.com/repos/baydindima/JavaCourse/git/commits{/sha}","comments_url":"https://api.github.com/repos/baydindima/JavaCourse/comments{/number}","issue_comment_url":"https://api.github.com/repos/baydindima/JavaCourse/issues/comments{/number}","contents_url":"https://api.github.com/repos/baydindima/JavaCourse/contents/{+path}","compare_url":"https://api.github.com/repos/baydindima/JavaCourse/compare/{base}...{head}","merges_url":"https://api.github.com/repos/baydindima/JavaCourse/merges","archive_url":"https://api.github.com/repos/baydindima/JavaCourse/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/baydindima/JavaCourse/downloads","issues_url":"https://api.github.com/repos/baydindima/JavaCourse/issues{/number}","pulls_url":"https://api.github.com/repos/baydindima/JavaCourse/pulls{/number}","milestones_url":"https://api.github.com/repos/baydindima/JavaCourse/milestones{/number}","notifications_url":"https://api.github.com/repos/baydindima/JavaCourse/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/baydindima/JavaCourse/labels{/name}","releases_url":"https://api.github.com/repos/baydindima/JavaCourse/releases{/id}","deployments_url":"https://api.github.com/repos/baydindima/JavaCourse/deployments","created_at":"2016-09-11T07:25:16Z","updated_at":"2016-09-21T08:52:56Z","pushed_at":"2016-10-19T09:20:50Z","git_url":"git://github.com/baydindima/JavaCourse.git","ssh_url":"git@github.com:baydindima/JavaCourse.git","clone_url":"https://github.com/baydindima/JavaCourse.git","svn_url":"https://github.com/baydindima/JavaCourse","homepage":null,"size":94,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/baydindima/JavaCourse/pulls/3"},"html":{"href":"https://github.com/baydindima/JavaCourse/pull/3"},"issue":{"href":"https://api.github.com/repos/baydindima/JavaCourse/issues/3"},"comments":{"href":"https://api.github.com/repos/baydindima/JavaCourse/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/baydindima/JavaCourse/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/baydindima/JavaCourse/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/baydindima/JavaCourse/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/baydindima/JavaCourse/statuses/4ac9cdac98b04108bf6ac7649a48f7ecb9ff022b"}}}}
{"actor":{"display_login":"jzuken"}}