Skip to content

Commit

Permalink
git svn: read global+system config for clone+init
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Eric Wong committed Nov 14, 2009
1 parent 753dc38 commit 1a30582
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions git-svn.perl
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ BEGIN

my %opts = %{$cmd{$cmd}->[2]} if (defined $cmd);

read_repo_config(\%opts);
read_git_config(\%opts);
if ($cmd && ($cmd eq 'log' || $cmd eq 'blame')) {
Getopt::Long::Configure('pass_through');
}
Expand Down Expand Up @@ -1390,8 +1390,7 @@ sub load_authors {
}

# convert GetOpt::Long specs for use by git-config
sub read_repo_config {
return unless -d $ENV{GIT_DIR};
sub read_git_config {
my $opts = shift;
my @config_only;
foreach my $o (keys %$opts) {
Expand Down

0 comments on commit 1a30582

Please sign in to comment.