git-svn: hide the private git-svn 'config' file as '.metadata'
[gitweb.git] / git-svn.perl
index d7fc9aad52fc1a9248b12057110ca6e549df4b09..571259fd098d7aa5ea280cdfb3c799f32492087c 100755 (executable)
@@ -1286,7 +1286,12 @@ sub get_fetch_range {
 
 sub tmp_config {
        my (@args) = @_;
-       my $config = "$ENV{GIT_DIR}/svn/config";
+       my $old_def_config = "$ENV{GIT_DIR}/svn/config";
+       my $config = "$ENV{GIT_DIR}/svn/.metadata";
+       if (-e $old_def_config && ! -e $config) {
+               rename $old_def_config, $config or
+                      die "Failed rename $old_def_config => $config: $!\n";
+       }
        my $old_config = $ENV{GIT_CONFIG};
        $ENV{GIT_CONFIG} = $config;
        $@ = undef;