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
if ( $args->{bare} ) {
unless ( touch $config ) {
}
else {
# write a default .cil file
- write_file($config, <<'CONFIG');
+ write_file($config, <<"CONFIG");
+$VCSconfig
+UserName: $username
+UserEmail: $user_email
StatusStrict: 1
StatusAllowedList: New
StatusAllowedList: InProgress
$self->git->command_output_pipe("cat-file", "blob", "$rev:$path");
}
+sub username {
+ return $_[0]->git->config( 'user.name' );
+}
+
+sub user_email {
+ return $_[0]->git->config( 'user.email' );
+}
+
## ----------------------------------------------------------------------------
1;
## ----------------------------------------------------------------------------