git svn: read global+system config for clone+init
Since $GIT_DIR does not exist when initializing new repositories, we can follow back to the global and system config files for git. The logic for this was originally introduced when $GIT_DIR/config was the only config file git could read (back when "git config" was "git repo-config"), so the function is renamed to "read_git_config" instead of "read_repo_config". Signed-off-by: Eric Wong <normalperson@yhbt.net>
Eric Wong committed
Nov 14, 2009 at 14:25 UTC
1a30582b43e137e16b3486d83bb86b0eb090e13d
1 file changed
+2
-3
git-svn.perl
+2
-3
@@ -274,7 +274,7 @@ unless ($cmd && $cmd =~ /(?:clone|init|multi-init)$/) {
274
275
my %opts = %{$cmd{$cmd}->[2]} if (defined $cmd);
276
277
-read_repo_config(\%opts);
277
+read_git_config(\%opts);
278
if ($cmd && ($cmd eq 'log' || $cmd eq 'blame')) {
279
Getopt::Long::Configure('pass_through');
280
}
@@ -1390,8 +1390,7 @@ sub load_authors {
1390
}
1391
1392
# convert GetOpt::Long specs for use by git-config
1393
-sub read_repo_config {
1394
- return unless -d $ENV{GIT_DIR};
1393
+sub read_git_config {
1394
my $opts = shift;
1395
my @config_only;
1396
foreach my $o (keys %$opts) {