diff --git a/prjgit-updater/main.go b/prjgit-updater/main.go index 16004e0..92e45eb 100644 --- a/prjgit-updater/main.go +++ b/prjgit-updater/main.go @@ -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 {