fatal("Couldn't create '$issues_dir' directory: $!");
}
- my $username = "unknown";
- my $user_email;
-
# are we in a Git repository?
my $VCSconfig = '';
if ( -d '.git' ) {
msg( 'git repository detected, setting VCS accordingly' );
$VCSconfig = 'VCS: git';
my $vcs = CIL::VCS::Factory->new( 'Git' );
- $username = $vcs->username if $vcs->username;
- $user_email = $vcs->user_email if $vcs->user_email;
}
# create a .cil file here also
# write a default .cil file
write_file($config, <<"CONFIG");
$VCSconfig
-UserName: $username
-UserEmail: $user_email
StatusStrict: 1
StatusAllowedList: New
StatusAllowedList: InProgress
StatusStrict StatusAllowed StatusOpen StatusClosed
LabelStrict LabelAllowed
VCS
- UserName UserEmail
vcs hook
vcs_revision
));
}
# set each config to be either the user defined one or the default
- foreach ( qw(UserName UserEmail) ) {
+ foreach ( qw() ) { # nothing yet
$self->$_( $cfg->{$_} || $defaults_user->{$_} );
}
}
}
}
+## ----------------------------------------------------------------------------
+# simple delegates to elsewhere
+
+sub UserName {
+ my ($self) = @_;
+ return $self->vcs->UserName
+}
+
+sub UserEmail {
+ my ($self) = @_;
+ return $self->vcs->UserEmail
+}
+
## ----------------------------------------------------------------------------
1;
## ----------------------------------------------------------------------------
$self->git->command_output_pipe("cat-file", "blob", "$rev:$path");
}
-sub username {
+sub UserName {
return $_[0]->git->config( 'user.name' );
}
-sub user_email {
+sub UserEmail {
return $_[0]->git->config( 'user.email' );
}