aboutsummaryrefslogtreecommitdiff
path: root/git-svn.perl
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2007-02-16 04:09:28 -0800
committerEric Wong <normalperson@yhbt.net>2007-02-23 00:57:13 -0800
commitb7e5348c7f6369554813207a24cf841f48bd8b23 (patch)
tree90d30a239e3879d463674d5fdfe7c0b07032db7e /git-svn.perl
parentd6d3346babaf19864ea104b0140279e62f32f7e3 (diff)
downloadgit-b7e5348c7f6369554813207a24cf841f48bd8b23.tar.gz
git-b7e5348c7f6369554813207a24cf841f48bd8b23.tar.xz
git-svn: hide the private git-svn 'config' file as '.metadata'
Having it named as 'config' prevents us from tracking a ref named 'config', which is a huge mistake. On the non-technical side, the word 'config' implies that a user can freely modify it; but that's not the case here. Signed-off-by: Eric Wong <normalperson@yhbt.net>
Diffstat (limited to 'git-svn.perl')
-rwxr-xr-xgit-svn.perl7
1 files changed, 6 insertions, 1 deletions
diff --git a/git-svn.perl b/git-svn.perl
index d7fc9aad5..571259fd0 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -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;