diff options
Diffstat (limited to 'git-cvsimport.perl')
-rwxr-xr-x | git-cvsimport.perl | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/git-cvsimport.perl b/git-cvsimport.perl index bf953543ac..58f5b11dc2 100755 --- a/git-cvsimport.perl +++ b/git-cvsimport.perl @@ -89,6 +89,14 @@ sub write_author_info($) { } # convert getopts specs for use by git config +my %longmap = ( + 'A:' => 'authors-file', + 'M:' => 'merge-regex', + 'P:' => undef, + 'R' => 'track-revisions', + 'S:' => 'ignore-paths', +); + sub read_repo_config { # Split the string between characters, unless there is a ':' # So "abc:de" becomes ["a", "b", "c:", "d", "e"] @@ -98,8 +106,17 @@ sub read_repo_config { $key =~ s/://g; my $arg = 'git config'; $arg .= ' --bool' if ($o !~ /:$/); - - chomp(my $tmp = `$arg --get cvsimport.$key`); + my $ckey = $key; + + if (exists $longmap{$o}) { + # An uppercase option like -R cannot be + # expressed in the configuration, as the + # variable names are downcased. + $ckey = $longmap{$o}; + next if (! defined $ckey); + $ckey =~ s/-//g; + } + chomp(my $tmp = `$arg --get cvsimport.$ckey`); if ($tmp && !($arg =~ /--bool/ && $tmp eq 'false')) { no strict 'refs'; my $opt_name = "opt_" . $key; |