IssueDir => 'issues', # the dir to save the issues in
StatusStrict => 0, # whether to complain if a status is invalid
LabelStrict => 0, # whether to complain if a label is invalid
+ VCS => 'Null', # don't do anything for VCS hooks
};
my @config_hashes = qw(StatusAllowed StatusOpen StatusClosed LabelAllowed);
$self->LabelAllowed( $cfg->{LabelAllowed} );
# if we are allowed this VCS, create the hook instance
- if ( exists $allowed->{vcs}{$cfg->{VCS}} ) {
- $self->VCS( $cfg->{VCS} );
- my $vcs = CIL::VCS::Factory->new( $cfg->{VCS} );
- $self->vcs( $vcs );
- }
+ $self->VCS( $cfg->{VCS} || 'Null' );
+ my $vcs = CIL::VCS::Factory->new( $cfg->{VCS} );
+ $self->vcs( $vcs );
}
sub register_hook {
use base qw( Class::Factory );
+__PACKAGE__->register_factory_type( Null => 'CIL::VCS::Null' );
__PACKAGE__->register_factory_type( Git => 'CIL::VCS::Git' );
foreach my $method_name ( qw(post_add) ) {
use warnings;
use Carp;
+use base qw(CIL::VCS::Factory);
+
foreach my $method_name ( qw(post_add) ) {
no strict 'refs';
- *{"${class}::$method_name"} = sub {};
+ *{"CIL::VCS::Null::$method_name"} = sub {};
}
## ----------------------------------------------------------------------------