Skip to content

Commit

Permalink
git-svn: hide the private git-svn 'config' file as '.metadata'
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Eric Wong committed Feb 23, 2007
1 parent d6d3346 commit b7e5348
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion git-svn.perl
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions t/t9107-git-svn-migrate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ test_expect_success 'setup old-looking metadata' "
git-svn init $svnrepo &&
git-svn fetch &&
mv $GIT_DIR/svn/* $GIT_DIR/ &&
mv $GIT_DIR/svn/.metadata $GIT_DIR/ &&
rmdir $GIT_DIR/svn &&
git-update-ref refs/heads/git-svn-HEAD refs/remotes/git-svn &&
git-update-ref refs/heads/svn-HEAD refs/remotes/git-svn &&
Expand Down

0 comments on commit b7e5348

Please sign in to comment.