summaryrefslogtreecommitdiff
path: root/git-svn.perl
diff options
context:
space:
mode:
authorGustaf Hendeby <hendeby@isy.liu.se>2007-11-24 14:47:56 +0100
committerEric Wong <normalperson@yhbt.net>2007-11-30 23:29:27 -0800
commitf4dd334bff85a203f71b3dfd086d8fd523db41ec (patch)
treee21b25786c2f0b6437c554a9d5be28a8f723ff7e /git-svn.perl
parent65c6a4696a760f518c9f262705de030323c11146 (diff)
downloadgit-f4dd334bff85a203f71b3dfd086d8fd523db41ec.tar.gz
git-svn now reads settings even if called in subdirectory
Previously, git-svn first read the .git/config file for settings as if current working directory was the repository top-directory, and after that made sure to cd into top-directory. The result was a silent failur to read configuration settings. This patch changes the order these two things are done. Signed-off-by: Gustaf Hendeby <hendeby@isy.liu.se> Acked-by: Eric Wong <normalperson@yhbt.net>
Diffstat (limited to 'git-svn.perl')
-rwxr-xr-xgit-svn.perl35
1 files changed, 18 insertions, 17 deletions
diff --git a/git-svn.perl b/git-svn.perl
index 43e1591cef..640a45af0c 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -193,23 +193,6 @@ for (my $i = 0; $i < @ARGV; $i++) {
}
};
-my %opts = %{$cmd{$cmd}->[2]} if (defined $cmd);
-
-read_repo_config(\%opts);
-Getopt::Long::Configure('pass_through') if ($cmd && $cmd eq 'log');
-my $rv = GetOptions(%opts, 'help|H|h' => \$_help, 'version|V' => \$_version,
- 'minimize-connections' => \$Git::SVN::Migration::_minimize,
- 'id|i=s' => \$Git::SVN::default_ref_id,
- 'svn-remote|remote|R=s' => sub {
- $Git::SVN::no_reuse_existing = 1;
- $Git::SVN::default_repo_id = $_[1] });
-exit 1 if (!$rv && $cmd && $cmd ne 'log');
-
-usage(0) if $_help;
-version() if $_version;
-usage(1) unless defined $cmd;
-load_authors() if $_authors;
-
# make sure we're always running
unless ($cmd =~ /(?:clone|init|multi-init)$/) {
unless (-d $ENV{GIT_DIR}) {
@@ -231,6 +214,24 @@ unless ($cmd =~ /(?:clone|init|multi-init)$/) {
$ENV{GIT_DIR} = $git_dir;
}
}
+
+my %opts = %{$cmd{$cmd}->[2]} if (defined $cmd);
+
+read_repo_config(\%opts);
+Getopt::Long::Configure('pass_through') if ($cmd && $cmd eq 'log');
+my $rv = GetOptions(%opts, 'help|H|h' => \$_help, 'version|V' => \$_version,
+ 'minimize-connections' => \$Git::SVN::Migration::_minimize,
+ 'id|i=s' => \$Git::SVN::default_ref_id,
+ 'svn-remote|remote|R=s' => sub {
+ $Git::SVN::no_reuse_existing = 1;
+ $Git::SVN::default_repo_id = $_[1] });
+exit 1 if (!$rv && $cmd && $cmd ne 'log');
+
+usage(0) if $_help;
+version() if $_version;
+usage(1) unless defined $cmd;
+load_authors() if $_authors;
+
unless ($cmd =~ /^(?:clone|init|multi-init|commit-diff)$/) {
Git::SVN::Migration::migration_check();
}