mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-12-23 16:59:48 +01:00
Implement branch provider to prevent errors
The review plugin does not explicitly check, if the branch provider is supported in events. It only checks, whether the repository supports branches per se. Therefor, if a tag is created from the ui, an internal server error is thrown. We prevent this by implementing a simple branch provider here, too.
This commit is contained in:
@@ -41,6 +41,7 @@ import sonia.scm.repository.PreReceiveRepositoryHookEvent;
|
||||
import sonia.scm.repository.RepositoryHookEvent;
|
||||
import sonia.scm.repository.RepositoryHookType;
|
||||
import sonia.scm.repository.Tag;
|
||||
import sonia.scm.repository.api.HookBranchProvider;
|
||||
import sonia.scm.repository.api.HookChangesetProvider;
|
||||
import sonia.scm.repository.api.HookContext;
|
||||
import sonia.scm.repository.api.HookContextFactory;
|
||||
@@ -220,6 +221,21 @@ public class GitTagCommand extends AbstractGitCommand implements TagCommand {
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public HookBranchProvider getBranchProvider() {
|
||||
return new HookBranchProvider() {
|
||||
@Override
|
||||
public List<String> getCreatedOrModified() {
|
||||
return List.of();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getDeletedOrClosed() {
|
||||
return List.of();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public HookChangesetProvider getChangesetProvider() {
|
||||
Collection<ReceiveCommand> receiveCommands = new ArrayList<>();
|
||||
|
||||
Reference in New Issue
Block a user