1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

Fix Collaborators cannot commit

This commit is contained in:
Unknown
2014-05-03 01:37:49 -04:00
parent e10096ee2e
commit 7b60756f2c
7 changed files with 45 additions and 36 deletions

View File

@@ -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())