From e36ef7a76e4cff5523a3362fd74b6cc6dc0ca072 Mon Sep 17 00:00:00 2001 From: Alex Date: Wed, 11 May 2011 15:24:41 +1000 Subject: Add commit-template support Reviewed-by: Rohan McGovern --- init-repository | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'init-repository') diff --git a/init-repository b/init-repository index 92ba994f..252fbb12 100755 --- a/init-repository +++ b/init-repository @@ -180,6 +180,7 @@ use Carp qw( confess ); use English qw( -no_match_vars ); use Getopt::Long qw( GetOptionsFromArray ); use Pod::Usage qw( pod2usage ); +use Cwd qw( getcwd ); my %PROTOCOLS = ( 'internal' => 'git://scm.dev.nokia.troll.no/' , @@ -332,6 +333,11 @@ sub git_submodule_init } $self->exe('git', 'submodule', 'init', @init_args); + my $template = getcwd()."/.commit-template"; + if (-e $template) { + $self->exe('git', 'config', 'commit.template', $template); + } + return; } @@ -478,6 +484,11 @@ sub git_clone_one_submodule $self->exe('git', 'fetch', ($mirror ? $mirror : $url)); } + my $template = getcwd()."/../.commit-template"; + if (-e $template) { + $self->exe('git', 'config', 'commit.template', $template); + } + if ($mirror) { $self->exe('git', 'config', 'remote.origin.url', $url); -- cgit v1.2.3