Fix nil reference in repo generation (#9660)
* Fix nil reference Signed-off-by: jolheiser <john.olheiser@gmail.com> * Tighten Signed-off-by: jolheiser <john.olheiser@gmail.com>
This commit is contained in:
parent
25531c71a7
commit
ee9ce0cfa9
1 changed files with 34 additions and 32 deletions
|
@ -124,6 +124,7 @@ func generateRepoCommit(e Engine, repo, templateRepo, generateRepo *Repository,
|
||||||
return fmt.Errorf("checkGiteaTemplate: %v", err)
|
return fmt.Errorf("checkGiteaTemplate: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if gt != nil {
|
||||||
if err := os.Remove(gt.Path); err != nil {
|
if err := os.Remove(gt.Path); err != nil {
|
||||||
return fmt.Errorf("remove .giteatemplate: %v", err)
|
return fmt.Errorf("remove .giteatemplate: %v", err)
|
||||||
}
|
}
|
||||||
|
@ -161,6 +162,7 @@ func generateRepoCommit(e Engine, repo, templateRepo, generateRepo *Repository,
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if err := git.InitRepository(tmpDir, false); err != nil {
|
if err := git.InitRepository(tmpDir, false); err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
Loading…
Reference in a new issue