1
0

Fix bug on undefined commiter name

هذا الالتزام موجود في:
Thomas Miceli
2023-04-04 02:01:31 +02:00
الأصل 746d836b99
التزام 5638bf7601
2 ملفات معدلة مع 14 إضافات و2 حذوفات

عرض الملف

@@ -129,7 +129,7 @@ func GetLog(user string, gist string, skip string) ([]*Commit, error) {
return parseLog(stdout), nil
}
func CloneTmp(user string, gist string, gistTmpId string) error {
func CloneTmp(user string, gist string, gistTmpId string, email string) error {
repositoryPath := RepositoryPath(user, gist)
tmpPath := TmpRepositoriesPath()
@@ -150,6 +150,18 @@ func CloneTmp(user string, gist string, gistTmpId string) error {
// remove every file (and not the .git directory!)
cmd = exec.Command("find", ".", "-maxdepth", "1", "-type", "f", "-delete")
cmd.Dir = tmpRepositoryPath
if err = cmd.Run(); err != nil {
return err
}
cmd = exec.Command("git", "config", "--local", "user.name", user)
cmd.Dir = tmpRepositoryPath
if err = cmd.Run(); err != nil {
return err
}
cmd = exec.Command("git", "config", "--local", "user.email", email)
cmd.Dir = tmpRepositoryPath
return cmd.Run()
}

عرض الملف

@@ -237,7 +237,7 @@ func (gist *Gist) NbCommits() (string, error) {
}
func (gist *Gist) AddAndCommitFiles(files *[]FileDTO) error {
if err := git.CloneTmp(gist.User.Username, gist.Uuid, gist.Uuid); err != nil {
if err := git.CloneTmp(gist.User.Username, gist.Uuid, gist.Uuid, gist.User.Email); err != nil {
return err
}