Do not remove git work directory in debug mode

This commit is contained in:
Adam Majer 2024-09-12 14:34:05 +02:00
parent 06228c58f3
commit b0b39726b8

View File

@ -84,7 +84,9 @@ func processConfiguredRepositoryAction(h *common.RequestHandler, action *common.
prjgit := config.GitProjectName
git, err := common.CreateGitHandler(GitAuthor, GitEmail, AppName)
common.PanicOnError(err)
// defer git.Close()
if !debugMode {
defer git.Close()
}
prjGitRepo, err := gitea.CreateRepositoryIfNotExist(git, *action.Organization, prjgit)
if err != nil {
@ -145,7 +147,9 @@ func processConfiguredPushAction(h *common.RequestHandler, action *common.PushWe
prjgit := config.GitProjectName
git, err := common.CreateGitHandler(GitAuthor, GitEmail, AppName)
common.PanicOnError(err)
defer git.Close()
if !debugMode {
defer git.Close()
}
prjGitRepo, err := gitea.CreateRepositoryIfNotExist(git, *action.Repository.Owner, prjgit)
if err != nil {