diff options
author | Unknown <joe2010xtmf@163.com> | 2014-05-03 01:37:49 -0400 |
---|---|---|
committer | Unknown <joe2010xtmf@163.com> | 2014-05-03 01:37:49 -0400 |
commit | 7b60756f2c56314af715fa884388a5654bbfb791 (patch) | |
tree | aab291357e23d6010e53dae80a51f66ed3294e20 /models/repo.go | |
parent | e10096ee2e7985cfd73553f52b09994af025cd93 (diff) | |
download | gitea-7b60756f2c56314af715fa884388a5654bbfb791.tar.gz gitea-7b60756f2c56314af715fa884388a5654bbfb791.zip |
Fix Collaborators cannot commit
Diffstat (limited to 'models/repo.go')
-rw-r--r-- | models/repo.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/models/repo.go b/models/repo.go index 35b3fde155..e8baadf6b0 100644 --- a/models/repo.go +++ b/models/repo.go @@ -379,10 +379,11 @@ func createHookUpdate(hookPath, content string) error { } // SetRepoEnvs sets environment variables for command update. -func SetRepoEnvs(userId int64, userName, repoName string) { +func SetRepoEnvs(userId int64, userName, repoName, repoUserName string) { os.Setenv("userId", base.ToStr(userId)) os.Setenv("userName", userName) os.Setenv("repoName", repoName) + os.Setenv("repoUserName", repoUserName) } // InitRepository initializes README and .gitignore if needed. @@ -459,7 +460,7 @@ func initRepository(f string, user *User, repo *Repository, initReadme bool, rep return nil } - SetRepoEnvs(user.Id, user.Name, repo.Name) + SetRepoEnvs(user.Id, user.Name, repo.Name, user.Name) // Apply changes and commit. return initRepoCommit(tmpDir, user.NewGitSig()) |