| | |
| | | import com.gitblit.client.Translation;
|
| | | import com.gitblit.models.RepositoryModel;
|
| | | import com.gitblit.models.UserModel;
|
| | | import com.gitblit.utils.ArrayUtils;
|
| | | import com.gitblit.utils.ClientLogger;
|
| | | import com.gitblit.utils.JGitUtils;
|
| | | import com.gitblit.utils.PushLogUtils;
|
| | | import com.gitblit.utils.RefLogUtils;
|
| | | import com.gitblit.utils.StringUtils;
|
| | |
|
| | | /**
|
| | |
| | |
|
| | | Set<String> scripts = new LinkedHashSet<String>();
|
| | | scripts.addAll(GitBlit.self().getPreReceiveScriptsInherited(repository));
|
| | | scripts.addAll(repository.preReceiveScripts);
|
| | | if (!ArrayUtils.isEmpty(repository.preReceiveScripts)) {
|
| | | scripts.addAll(repository.preReceiveScripts);
|
| | | }
|
| | | runGroovy(repository, user, commands, rp, scripts);
|
| | | for (ReceiveCommand cmd : commands) {
|
| | | if (!Result.NOT_ATTEMPTED.equals(cmd.getResult())) {
|
| | |
| | |
|
| | | // update push log
|
| | | try {
|
| | | PushLogUtils.updatePushLog(user, rp.getRepository(), commands);
|
| | | RefLogUtils.updateRefLog(user, rp.getRepository(), commands);
|
| | | logger.debug(MessageFormat.format("{0} push log updated", repository.name));
|
| | | } catch (Exception e) {
|
| | | logger.error(MessageFormat.format("Failed to update {0} pushlog", repository.name), e);
|
| | |
| | | // run Groovy hook scripts
|
| | | Set<String> scripts = new LinkedHashSet<String>();
|
| | | scripts.addAll(GitBlit.self().getPostReceiveScriptsInherited(repository));
|
| | | scripts.addAll(repository.postReceiveScripts);
|
| | | if (!ArrayUtils.isEmpty(repository.postReceiveScripts)) {
|
| | | scripts.addAll(repository.postReceiveScripts);
|
| | | }
|
| | | runGroovy(repository, user, commands, rp, scripts);
|
| | | }
|
| | |
|