{"action":"created","comment":{"url":"https://api.github.com/repos/gitlabhq/gitlabhq/pulls/comments/23285815","id":23285815,"diff_hunk":"@@ -1,16 +1,67 @@\n class Projects::NewTreeController < Projects::BaseTreeController\n   before_filter :require_branch_head\n   before_filter :authorize_push_code!\n-\n+   \n   def show\n   end\n \n   def update\n-    file_path = File.join(@path, File.basename(params[:file_name]))\n-    result = Files::CreateService.new(@project, current_user, params, @ref, file_path).execute\n+    flag = 0\n+    # replace & upload \n+    if params[:file_upload] != nil\n+    # get the name of the upload file\n+      file_na = params[:file_upload].original_filename\n+      file_path = nil\n+\n+      if file_na != nil\n+        file_list = tree.entries.select(&:file?)\t \n+        dir_list = tree.entries.select(&:dir?)\n \n+        # check whether current path is sub-repository\n+\tdir_list.each do |dir|\t\t\n+\t  if dir.name != nil\n+            flag = 1\n+\t  end\n+\tend\n+\t# check whether current path is sub-repository\t\t\n+\tfile_list.each do |file|\t","path":"app/controllers/projects/new_tree_controller.rb","position":30,"original_position":30,"commit_id":"c5605425cc8db1c1e8fe972972571d73218c2c2c","original_commit_id":"c5605425cc8db1c1e8fe972972571d73218c2c2c","user":{"login":"houndci","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci","html_url":"https://github.com/houndci","followers_url":"https://api.github.com/users/houndci/followers","following_url":"https://api.github.com/users/houndci/following{/other_user}","gists_url":"https://api.github.com/users/houndci/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci/subscriptions","organizations_url":"https://api.github.com/users/houndci/orgs","repos_url":"https://api.github.com/users/houndci/repos","events_url":"https://api.github.com/users/houndci/events{/privacy}","received_events_url":"https://api.github.com/users/houndci/received_events","type":"User","site_admin":false},"body":"Inconsistent indentation detected.<br>Tab detected.<br>Trailing whitespace detected.","created_at":"2015-01-21T09:05:55Z","updated_at":"2015-01-21T09:05:55Z","html_url":"https://github.com/gitlabhq/gitlabhq/pull/8594#discussion_r23285815","pull_request_url":"https://api.github.com/repos/gitlabhq/gitlabhq/pulls/8594","_links":{"self":{"href":"https://api.github.com/repos/gitlabhq/gitlabhq/pulls/comments/23285815"},"html":{"href":"https://github.com/gitlabhq/gitlabhq/pull/8594#discussion_r23285815"},"pull_request":{"href":"https://api.github.com/repos/gitlabhq/gitlabhq/pulls/8594"}}},"pull_request":{"url":"https://api.github.com/repos/gitlabhq/gitlabhq/pulls/8594","id":27520466,"html_url":"https://github.com/gitlabhq/gitlabhq/pull/8594","diff_url":"https://github.com/gitlabhq/gitlabhq/pull/8594.diff","patch_url":"https://github.com/gitlabhq/gitlabhq/pull/8594.patch","issue_url":"https://api.github.com/repos/gitlabhq/gitlabhq/issues/8594","number":8594,"state":"open","locked":false,"title":"add \"upload\" functionality and \"replace\" functionality ","user":{"login":"liyakun","id":7370334,"avatar_url":"https://avatars.githubusercontent.com/u/7370334?v=3","gravatar_id":"","url":"https://api.github.com/users/liyakun","html_url":"https://github.com/liyakun","followers_url":"https://api.github.com/users/liyakun/followers","following_url":"https://api.github.com/users/liyakun/following{/other_user}","gists_url":"https://api.github.com/users/liyakun/gists{/gist_id}","starred_url":"https://api.github.com/users/liyakun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/liyakun/subscriptions","organizations_url":"https://api.github.com/users/liyakun/orgs","repos_url":"https://api.github.com/users/liyakun/repos","events_url":"https://api.github.com/users/liyakun/events{/privacy}","received_events_url":"https://api.github.com/users/liyakun/received_events","type":"User","site_admin":false},"body":"Functions to add new file to current repository and replace the existing file in current repository are added.\r\n\r\nUpdate show.html.haml\r\n\r\nadd 'upload' view\r\n\r\nUpdate _tree.html.haml\r\n\r\nadd 'upload' button\r\n\r\nCreate _upload.html.haml\r\n\r\nshow upload window\r\n\r\nUpdate file_action.rb\r\n\r\nallow user to upload both base64 file and text file\r\n\r\nUpdate _actions.html.haml\r\n\r\nadd replace action button\r\n\r\nUpdate show.html.haml\r\n\r\nadd replace (update) view\r\n\r\nCreate _update.html.haml\r\n\r\nshow update window\r\n\r\nUpdate CHANGELOG\r\n\r\n\r\n![replace_01](https://cloud.githubusercontent.com/assets/7370334/5780422/c8d5185c-9daa-11e4-8801-aec8ad8b0e44.png)\r\n![replace_02](https://cloud.githubusercontent.com/assets/7370334/5780419/c8d03954-9daa-11e4-9429-4912be7c9f01.png)\r\n![upload_01](https://cloud.githubusercontent.com/assets/7370334/5780420/c8d3cdc6-9daa-11e4-9747-8e5446b11f15.png)\r\n![upload_02](https://cloud.githubusercontent.com/assets/7370334/5780421/c8d45854-9daa-11e4-9737-f6b788352960.png)","created_at":"2015-01-16T17:10:01Z","updated_at":"2015-01-21T09:05:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5f5aed4ff727e7491048315cbfa1121b41e2d26e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/gitlabhq/gitlabhq/pulls/8594/commits","review_comments_url":"https://api.github.com/repos/gitlabhq/gitlabhq/pulls/8594/comments","review_comment_url":"https://api.github.com/repos/gitlabhq/gitlabhq/pulls/comments/{number}","comments_url":"https://api.github.com/repos/gitlabhq/gitlabhq/issues/8594/comments","statuses_url":"https://api.github.com/repos/gitlabhq/gitlabhq/statuses/c5605425cc8db1c1e8fe972972571d73218c2c2c","head":{"label":"liyakun:master","ref":"master","sha":"c5605425cc8db1c1e8fe972972571d73218c2c2c","user":{"login":"liyakun","id":7370334,"avatar_url":"https://avatars.githubusercontent.com/u/7370334?v=3","gravatar_id":"","url":"https://api.github.com/users/liyakun","html_url":"https://github.com/liyakun","followers_url":"https://api.github.com/users/liyakun/followers","following_url":"https://api.github.com/users/liyakun/following{/other_user}","gists_url":"https://api.github.com/users/liyakun/gists{/gist_id}","starred_url":"https://api.github.com/users/liyakun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/liyakun/subscriptions","organizations_url":"https://api.github.com/users/liyakun/orgs","repos_url":"https://api.github.com/users/liyakun/repos","events_url":"https://api.github.com/users/liyakun/events{/privacy}","received_events_url":"https://api.github.com/users/liyakun/received_events","type":"User","site_admin":false},"repo":{"id":27488416,"name":"gitlabhq","full_name":"liyakun/gitlabhq","owner":{"login":"liyakun","id":7370334,"avatar_url":"https://avatars.githubusercontent.com/u/7370334?v=3","gravatar_id":"","url":"https://api.github.com/users/liyakun","html_url":"https://github.com/liyakun","followers_url":"https://api.github.com/users/liyakun/followers","following_url":"https://api.github.com/users/liyakun/following{/other_user}","gists_url":"https://api.github.com/users/liyakun/gists{/gist_id}","starred_url":"https://api.github.com/users/liyakun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/liyakun/subscriptions","organizations_url":"https://api.github.com/users/liyakun/orgs","repos_url":"https://api.github.com/users/liyakun/repos","events_url":"https://api.github.com/users/liyakun/events{/privacy}","received_events_url":"https://api.github.com/users/liyakun/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/liyakun/gitlabhq","description":"Open source software to collaborate on code. Follow us on twitter @gitlabhq","fork":true,"url":"https://api.github.com/repos/liyakun/gitlabhq","forks_url":"https://api.github.com/repos/liyakun/gitlabhq/forks","keys_url":"https://api.github.com/repos/liyakun/gitlabhq/keys{/key_id}","collaborators_url":"https://api.github.com/repos/liyakun/gitlabhq/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/liyakun/gitlabhq/teams","hooks_url":"https://api.github.com/repos/liyakun/gitlabhq/hooks","issue_events_url":"https://api.github.com/repos/liyakun/gitlabhq/issues/events{/number}","events_url":"https://api.github.com/repos/liyakun/gitlabhq/events","assignees_url":"https://api.github.com/repos/liyakun/gitlabhq/assignees{/user}","branches_url":"https://api.github.com/repos/liyakun/gitlabhq/branches{/branch}","tags_url":"https://api.github.com/repos/liyakun/gitlabhq/tags","blobs_url":"https://api.github.com/repos/liyakun/gitlabhq/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/liyakun/gitlabhq/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/liyakun/gitlabhq/git/refs{/sha}","trees_url":"https://api.github.com/repos/liyakun/gitlabhq/git/trees{/sha}","statuses_url":"https://api.github.com/repos/liyakun/gitlabhq/statuses/{sha}","languages_url":"https://api.github.com/repos/liyakun/gitlabhq/languages","stargazers_url":"https://api.github.com/repos/liyakun/gitlabhq/stargazers","contributors_url":"https://api.github.com/repos/liyakun/gitlabhq/contributors","subscribers_url":"https://api.github.com/repos/liyakun/gitlabhq/subscribers","subscription_url":"https://api.github.com/repos/liyakun/gitlabhq/subscription","commits_url":"https://api.github.com/repos/liyakun/gitlabhq/commits{/sha}","git_commits_url":"https://api.github.com/repos/liyakun/gitlabhq/git/commits{/sha}","comments_url":"https://api.github.com/repos/liyakun/gitlabhq/comments{/number}","issue_comment_url":"https://api.github.com/repos/liyakun/gitlabhq/issues/comments/{number}","contents_url":"https://api.github.com/repos/liyakun/gitlabhq/contents/{+path}","compare_url":"https://api.github.com/repos/liyakun/gitlabhq/compare/{base}...{head}","merges_url":"https://api.github.com/repos/liyakun/gitlabhq/merges","archive_url":"https://api.github.com/repos/liyakun/gitlabhq/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/liyakun/gitlabhq/downloads","issues_url":"https://api.github.com/repos/liyakun/gitlabhq/issues{/number}","pulls_url":"https://api.github.com/repos/liyakun/gitlabhq/pulls{/number}","milestones_url":"https://api.github.com/repos/liyakun/gitlabhq/milestones{/number}","notifications_url":"https://api.github.com/repos/liyakun/gitlabhq/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/liyakun/gitlabhq/labels{/name}","releases_url":"https://api.github.com/repos/liyakun/gitlabhq/releases{/id}","created_at":"2014-12-03T13:28:42Z","updated_at":"2015-01-21T09:05:44Z","pushed_at":"2015-01-21T09:05:44Z","git_url":"git://github.com/liyakun/gitlabhq.git","ssh_url":"git@github.com:liyakun/gitlabhq.git","clone_url":"https://github.com/liyakun/gitlabhq.git","svn_url":"https://github.com/liyakun/gitlabhq","homepage":"https://about.gitlab.com/","size":86448,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"gitlabhq:master","ref":"master","sha":"ada6c6080b2fa0d63003f8b29b5c32195254906d","user":{"login":"gitlabhq","id":1086321,"avatar_url":"https://avatars.githubusercontent.com/u/1086321?v=3","gravatar_id":"","url":"https://api.github.com/users/gitlabhq","html_url":"https://github.com/gitlabhq","followers_url":"https://api.github.com/users/gitlabhq/followers","following_url":"https://api.github.com/users/gitlabhq/following{/other_user}","gists_url":"https://api.github.com/users/gitlabhq/gists{/gist_id}","starred_url":"https://api.github.com/users/gitlabhq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gitlabhq/subscriptions","organizations_url":"https://api.github.com/users/gitlabhq/orgs","repos_url":"https://api.github.com/users/gitlabhq/repos","events_url":"https://api.github.com/users/gitlabhq/events{/privacy}","received_events_url":"https://api.github.com/users/gitlabhq/received_events","type":"Organization","site_admin":false},"repo":{"id":2500088,"name":"gitlabhq","full_name":"gitlabhq/gitlabhq","owner":{"login":"gitlabhq","id":1086321,"avatar_url":"https://avatars.githubusercontent.com/u/1086321?v=3","gravatar_id":"","url":"https://api.github.com/users/gitlabhq","html_url":"https://github.com/gitlabhq","followers_url":"https://api.github.com/users/gitlabhq/followers","following_url":"https://api.github.com/users/gitlabhq/following{/other_user}","gists_url":"https://api.github.com/users/gitlabhq/gists{/gist_id}","starred_url":"https://api.github.com/users/gitlabhq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gitlabhq/subscriptions","organizations_url":"https://api.github.com/users/gitlabhq/orgs","repos_url":"https://api.github.com/users/gitlabhq/repos","events_url":"https://api.github.com/users/gitlabhq/events{/privacy}","received_events_url":"https://api.github.com/users/gitlabhq/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/gitlabhq/gitlabhq","description":"Open source software to collaborate on code. Follow us on twitter @gitlab","fork":false,"url":"https://api.github.com/repos/gitlabhq/gitlabhq","forks_url":"https://api.github.com/repos/gitlabhq/gitlabhq/forks","keys_url":"https://api.github.com/repos/gitlabhq/gitlabhq/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gitlabhq/gitlabhq/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gitlabhq/gitlabhq/teams","hooks_url":"https://api.github.com/repos/gitlabhq/gitlabhq/hooks","issue_events_url":"https://api.github.com/repos/gitlabhq/gitlabhq/issues/events{/number}","events_url":"https://api.github.com/repos/gitlabhq/gitlabhq/events","assignees_url":"https://api.github.com/repos/gitlabhq/gitlabhq/assignees{/user}","branches_url":"https://api.github.com/repos/gitlabhq/gitlabhq/branches{/branch}","tags_url":"https://api.github.com/repos/gitlabhq/gitlabhq/tags","blobs_url":"https://api.github.com/repos/gitlabhq/gitlabhq/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gitlabhq/gitlabhq/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gitlabhq/gitlabhq/git/refs{/sha}","trees_url":"https://api.github.com/repos/gitlabhq/gitlabhq/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gitlabhq/gitlabhq/statuses/{sha}","languages_url":"https://api.github.com/repos/gitlabhq/gitlabhq/languages","stargazers_url":"https://api.github.com/repos/gitlabhq/gitlabhq/stargazers","contributors_url":"https://api.github.com/repos/gitlabhq/gitlabhq/contributors","subscribers_url":"https://api.github.com/repos/gitlabhq/gitlabhq/subscribers","subscription_url":"https://api.github.com/repos/gitlabhq/gitlabhq/subscription","commits_url":"https://api.github.com/repos/gitlabhq/gitlabhq/commits{/sha}","git_commits_url":"https://api.github.com/repos/gitlabhq/gitlabhq/git/commits{/sha}","comments_url":"https://api.github.com/repos/gitlabhq/gitlabhq/comments{/number}","issue_comment_url":"https://api.github.com/repos/gitlabhq/gitlabhq/issues/comments/{number}","contents_url":"https://api.github.com/repos/gitlabhq/gitlabhq/contents/{+path}","compare_url":"https://api.github.com/repos/gitlabhq/gitlabhq/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gitlabhq/gitlabhq/merges","archive_url":"https://api.github.com/repos/gitlabhq/gitlabhq/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gitlabhq/gitlabhq/downloads","issues_url":"https://api.github.com/repos/gitlabhq/gitlabhq/issues{/number}","pulls_url":"https://api.github.com/repos/gitlabhq/gitlabhq/pulls{/number}","milestones_url":"https://api.github.com/repos/gitlabhq/gitlabhq/milestones{/number}","notifications_url":"https://api.github.com/repos/gitlabhq/gitlabhq/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gitlabhq/gitlabhq/labels{/name}","releases_url":"https://api.github.com/repos/gitlabhq/gitlabhq/releases{/id}","created_at":"2011-10-02T16:25:27Z","updated_at":"2015-01-21T07:09:44Z","pushed_at":"2015-01-21T07:09:43Z","git_url":"git://github.com/gitlabhq/gitlabhq.git","ssh_url":"git@github.com:gitlabhq/gitlabhq.git","clone_url":"https://github.com/gitlabhq/gitlabhq.git","svn_url":"https://github.com/gitlabhq/gitlabhq","homepage":"https://about.gitlab.com/","size":142846,"stargazers_count":14699,"watchers_count":14699,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3859,"mirror_url":null,"open_issues_count":724,"forks":3859,"open_issues":724,"watchers":14699,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/gitlabhq/gitlabhq/pulls/8594"},"html":{"href":"https://github.com/gitlabhq/gitlabhq/pull/8594"},"issue":{"href":"https://api.github.com/repos/gitlabhq/gitlabhq/issues/8594"},"comments":{"href":"https://api.github.com/repos/gitlabhq/gitlabhq/issues/8594/comments"},"review_comments":{"href":"https://api.github.com/repos/gitlabhq/gitlabhq/pulls/8594/comments"},"review_comment":{"href":"https://api.github.com/repos/gitlabhq/gitlabhq/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/gitlabhq/gitlabhq/pulls/8594/commits"},"statuses":{"href":"https://api.github.com/repos/gitlabhq/gitlabhq/statuses/c5605425cc8db1c1e8fe972972571d73218c2c2c"}}}}