@matheusbsbs / matheus-bagliano / commits / b7e5348c7f
Fork 0

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>

Eric Wong committed Feb 16, 2007 at 04:09 UTC b7e5348c7f6369554813207a24cf841f48bd8b23
2 files changed +7 -1
git-svn.perl
+6 -1
@@ -1286,7 +1286,12 @@ sub get_fetch_range {
1286
1287 sub tmp_config {
1288 my (@args) = @_;
1289 - my $config = "$ENV{GIT_DIR}/svn/config";
1289 + my $old_def_config = "$ENV{GIT_DIR}/svn/config";
1290 + my $config = "$ENV{GIT_DIR}/svn/.metadata";
1291 + if (-e $old_def_config && ! -e $config) {
1292 + rename $old_def_config, $config or
1293 + die "Failed rename $old_def_config => $config: $!\n";
1294 + }
1295 my $old_config = $ENV{GIT_CONFIG};
1296 $ENV{GIT_CONFIG} = $config;
1297 $@ = undef;
t/t9107-git-svn-migrate.sh
+1
@@ -17,6 +17,7 @@ test_expect_success 'setup old-looking metadata' "
17 git-svn init $svnrepo &&
18 git-svn fetch &&
19 mv $GIT_DIR/svn/* $GIT_DIR/ &&
20 + mv $GIT_DIR/svn/.metadata $GIT_DIR/ &&
21 rmdir $GIT_DIR/svn &&
22 git-update-ref refs/heads/git-svn-HEAD refs/remotes/git-svn &&
23 git-update-ref refs/heads/svn-HEAD refs/remotes/git-svn &&