{"action":"created","comment":{"url":"https://api.github.com/repos/go-gitea/gitea/pulls/comments/31775465","id":31775465,"diff_hunk":"@@ -100,12 +101,14 @@ func Install(ctx *middleware.Context) {\n \t// Note(unknwon): it's hard for Windows users change a running user,\n \t// \tso just use current one if config says default.\n \tif setting.IsWindows && setting.RunUser == \"git\" {\n-\t\tform.RunUser = os.Getenv(\"USER\")\n-\t\tif len(form.RunUser) == 0 {\n-\t\t\tform.RunUser = os.Getenv(\"USERNAME\")\n+\n+\t\t// user.Current returns back a *User, while form.RunUser is a string\n+\t\tWhoAmI, err := user.Current()\n+\t\tif err == nil {\n+\t\t\tform.RunUser = WhoAmI.Username\n+\t\t} else {\n+\t\t\tform.RunUser = setting.RunUser\n \t\t}\n-\t} else {\n-\t\tform.RunUser = setting.RunUser","path":"routers/install.go","position":49,"original_position":49,"commit_id":"d3ad52170d1431007fc83eaf02f4cd358c9b8473","original_commit_id":"d3ad52170d1431007fc83eaf02f4cd358c9b8473","user":{"login":"lunny","id":81045,"avatar_url":"https://avatars.githubusercontent.com/u/81045?v=3","gravatar_id":"","url":"https://api.github.com/users/lunny","html_url":"https://github.com/lunny","followers_url":"https://api.github.com/users/lunny/followers","following_url":"https://api.github.com/users/lunny/following{/other_user}","gists_url":"https://api.github.com/users/lunny/gists{/gist_id}","starred_url":"https://api.github.com/users/lunny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lunny/subscriptions","organizations_url":"https://api.github.com/users/lunny/orgs","repos_url":"https://api.github.com/users/lunny/repos","events_url":"https://api.github.com/users/lunny/events{/privacy}","received_events_url":"https://api.github.com/users/lunny/received_events","type":"User","site_admin":false},"body":"Why remove these two lines?","created_at":"2015-06-04T23:11:06Z","updated_at":"2015-06-04T23:11:06Z","html_url":"https://github.com/go-gitea/gitea/pull/21#discussion_r31775465","pull_request_url":"https://api.github.com/repos/go-gitea/gitea/pulls/21","_links":{"self":{"href":"https://api.github.com/repos/go-gitea/gitea/pulls/comments/31775465"},"html":{"href":"https://github.com/go-gitea/gitea/pull/21#discussion_r31775465"},"pull_request":{"href":"https://api.github.com/repos/go-gitea/gitea/pulls/21"}}},"pull_request":{"url":"https://api.github.com/repos/go-gitea/gitea/pulls/21","id":36949461,"html_url":"https://github.com/go-gitea/gitea/pull/21","diff_url":"https://github.com/go-gitea/gitea/pull/21.diff","patch_url":"https://github.com/go-gitea/gitea/pull/21.patch","issue_url":"https://api.github.com/repos/go-gitea/gitea/issues/21","number":21,"state":"open","locked":false,"title":"Removing the environment string from the code and using os/user","user":{"login":"uriel-fanelli","id":4519054,"avatar_url":"https://avatars.githubusercontent.com/u/4519054?v=3","gravatar_id":"","url":"https://api.github.com/users/uriel-fanelli","html_url":"https://github.com/uriel-fanelli","followers_url":"https://api.github.com/users/uriel-fanelli/followers","following_url":"https://api.github.com/users/uriel-fanelli/following{/other_user}","gists_url":"https://api.github.com/users/uriel-fanelli/gists{/gist_id}","starred_url":"https://api.github.com/users/uriel-fanelli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uriel-fanelli/subscriptions","organizations_url":"https://api.github.com/users/uriel-fanelli/orgs","repos_url":"https://api.github.com/users/uriel-fanelli/repos","events_url":"https://api.github.com/users/uriel-fanelli/events{/privacy}","received_events_url":"https://api.github.com/users/uriel-fanelli/received_events","type":"User","site_admin":false},"body":"*User.Username contains the string the code seems to want.","created_at":"2015-06-04T15:57:21Z","updated_at":"2015-06-04T23:11:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/go-gitea/gitea/pulls/21/commits","review_comments_url":"https://api.github.com/repos/go-gitea/gitea/pulls/21/comments","review_comment_url":"https://api.github.com/repos/go-gitea/gitea/pulls/comments{/number}","comments_url":"https://api.github.com/repos/go-gitea/gitea/issues/21/comments","statuses_url":"https://api.github.com/repos/go-gitea/gitea/statuses/d3ad52170d1431007fc83eaf02f4cd358c9b8473","head":{"label":"uriel-fanelli:uriel.fanelli","ref":"uriel.fanelli","sha":"d3ad52170d1431007fc83eaf02f4cd358c9b8473","user":{"login":"uriel-fanelli","id":4519054,"avatar_url":"https://avatars.githubusercontent.com/u/4519054?v=3","gravatar_id":"","url":"https://api.github.com/users/uriel-fanelli","html_url":"https://github.com/uriel-fanelli","followers_url":"https://api.github.com/users/uriel-fanelli/followers","following_url":"https://api.github.com/users/uriel-fanelli/following{/other_user}","gists_url":"https://api.github.com/users/uriel-fanelli/gists{/gist_id}","starred_url":"https://api.github.com/users/uriel-fanelli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uriel-fanelli/subscriptions","organizations_url":"https://api.github.com/users/uriel-fanelli/orgs","repos_url":"https://api.github.com/users/uriel-fanelli/repos","events_url":"https://api.github.com/users/uriel-fanelli/events{/privacy}","received_events_url":"https://api.github.com/users/uriel-fanelli/received_events","type":"User","site_admin":false},"repo":null},"base":{"label":"go-gitea:develop","ref":"develop","sha":"539367c52b9db6abb542b9135979965504e32168","user":{"login":"go-gitea","id":12724356,"avatar_url":"https://avatars.githubusercontent.com/u/12724356?v=3","gravatar_id":"","url":"https://api.github.com/users/go-gitea","html_url":"https://github.com/go-gitea","followers_url":"https://api.github.com/users/go-gitea/followers","following_url":"https://api.github.com/users/go-gitea/following{/other_user}","gists_url":"https://api.github.com/users/go-gitea/gists{/gist_id}","starred_url":"https://api.github.com/users/go-gitea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/go-gitea/subscriptions","organizations_url":"https://api.github.com/users/go-gitea/orgs","repos_url":"https://api.github.com/users/go-gitea/repos","events_url":"https://api.github.com/users/go-gitea/events{/privacy}","received_events_url":"https://api.github.com/users/go-gitea/received_events","type":"Organization","site_admin":false},"repo":{"id":36789116,"name":"gitea","full_name":"go-gitea/gitea","owner":{"login":"go-gitea","id":12724356,"avatar_url":"https://avatars.githubusercontent.com/u/12724356?v=3","gravatar_id":"","url":"https://api.github.com/users/go-gitea","html_url":"https://github.com/go-gitea","followers_url":"https://api.github.com/users/go-gitea/followers","following_url":"https://api.github.com/users/go-gitea/following{/other_user}","gists_url":"https://api.github.com/users/go-gitea/gists{/gist_id}","starred_url":"https://api.github.com/users/go-gitea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/go-gitea/subscriptions","organizations_url":"https://api.github.com/users/go-gitea/orgs","repos_url":"https://api.github.com/users/go-gitea/repos","events_url":"https://api.github.com/users/go-gitea/events{/privacy}","received_events_url":"https://api.github.com/users/go-gitea/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/go-gitea/gitea","description":"Git with a cup of tea, forked from Gogs","fork":false,"url":"https://api.github.com/repos/go-gitea/gitea","forks_url":"https://api.github.com/repos/go-gitea/gitea/forks","keys_url":"https://api.github.com/repos/go-gitea/gitea/keys{/key_id}","collaborators_url":"https://api.github.com/repos/go-gitea/gitea/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/go-gitea/gitea/teams","hooks_url":"https://api.github.com/repos/go-gitea/gitea/hooks","issue_events_url":"https://api.github.com/repos/go-gitea/gitea/issues/events{/number}","events_url":"https://api.github.com/repos/go-gitea/gitea/events","assignees_url":"https://api.github.com/repos/go-gitea/gitea/assignees{/user}","branches_url":"https://api.github.com/repos/go-gitea/gitea/branches{/branch}","tags_url":"https://api.github.com/repos/go-gitea/gitea/tags","blobs_url":"https://api.github.com/repos/go-gitea/gitea/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/go-gitea/gitea/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/go-gitea/gitea/git/refs{/sha}","trees_url":"https://api.github.com/repos/go-gitea/gitea/git/trees{/sha}","statuses_url":"https://api.github.com/repos/go-gitea/gitea/statuses/{sha}","languages_url":"https://api.github.com/repos/go-gitea/gitea/languages","stargazers_url":"https://api.github.com/repos/go-gitea/gitea/stargazers","contributors_url":"https://api.github.com/repos/go-gitea/gitea/contributors","subscribers_url":"https://api.github.com/repos/go-gitea/gitea/subscribers","subscription_url":"https://api.github.com/repos/go-gitea/gitea/subscription","commits_url":"https://api.github.com/repos/go-gitea/gitea/commits{/sha}","git_commits_url":"https://api.github.com/repos/go-gitea/gitea/git/commits{/sha}","comments_url":"https://api.github.com/repos/go-gitea/gitea/comments{/number}","issue_comment_url":"https://api.github.com/repos/go-gitea/gitea/issues/comments{/number}","contents_url":"https://api.github.com/repos/go-gitea/gitea/contents/{+path}","compare_url":"https://api.github.com/repos/go-gitea/gitea/compare/{base}...{head}","merges_url":"https://api.github.com/repos/go-gitea/gitea/merges","archive_url":"https://api.github.com/repos/go-gitea/gitea/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/go-gitea/gitea/downloads","issues_url":"https://api.github.com/repos/go-gitea/gitea/issues{/number}","pulls_url":"https://api.github.com/repos/go-gitea/gitea/pulls{/number}","milestones_url":"https://api.github.com/repos/go-gitea/gitea/milestones{/number}","notifications_url":"https://api.github.com/repos/go-gitea/gitea/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/go-gitea/gitea/labels{/name}","releases_url":"https://api.github.com/repos/go-gitea/gitea/releases{/id}","created_at":"2015-06-03T08:05:37Z","updated_at":"2015-06-04T22:48:41Z","pushed_at":"2015-06-04T15:57:21Z","git_url":"git://github.com/go-gitea/gitea.git","ssh_url":"git@github.com:go-gitea/gitea.git","clone_url":"https://github.com/go-gitea/gitea.git","svn_url":"https://github.com/go-gitea/gitea","homepage":"http://gitea.io","size":0,"stargazers_count":36,"watchers_count":36,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":13,"forks":6,"open_issues":13,"watchers":36,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/go-gitea/gitea/pulls/21"},"html":{"href":"https://github.com/go-gitea/gitea/pull/21"},"issue":{"href":"https://api.github.com/repos/go-gitea/gitea/issues/21"},"comments":{"href":"https://api.github.com/repos/go-gitea/gitea/issues/21/comments"},"review_comments":{"href":"https://api.github.com/repos/go-gitea/gitea/pulls/21/comments"},"review_comment":{"href":"https://api.github.com/repos/go-gitea/gitea/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/go-gitea/gitea/pulls/21/commits"},"statuses":{"href":"https://api.github.com/repos/go-gitea/gitea/statuses/d3ad52170d1431007fc83eaf02f4cd358c9b8473"}}}}