summaryrefslogtreecommitdiff
path: root/contrib/git-svn
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <junkio@cox.net>2006-07-03 03:14:32 -0700
committerLibravatar Junio C Hamano <junkio@cox.net>2006-07-03 03:16:52 -0700
commitf23c75a8eca5eeabf9aaf303ee7e14a94da42ddc (patch)
treee8379d2e091dcdabb623ebbe8b7a1ee53be308a9 /contrib/git-svn
parentrevert clear-commit-marks for now. (diff)
parentMakefile: tighten git-http-{fetch,push} dependencies (diff)
downloadtgif-f23c75a8eca5eeabf9aaf303ee7e14a94da42ddc.tar.xz
Merge branch 'master' into js/merge-base
This is to pull in the object-hash clean-up from the master branch.
Diffstat (limited to 'contrib/git-svn')
-rwxr-xr-xcontrib/git-svn/git-svn.perl14
1 files changed, 12 insertions, 2 deletions
diff --git a/contrib/git-svn/git-svn.perl b/contrib/git-svn/git-svn.perl
index b3d3f479da..1e19aa19b2 100755
--- a/contrib/git-svn/git-svn.perl
+++ b/contrib/git-svn/git-svn.perl
@@ -264,9 +264,19 @@ when you have upgraded your tools and habits to use refs/remotes/$GIT_SVN
}
sub init {
- $SVN_URL = shift or die "SVN repository location required " .
+ my $url = shift or die "SVN repository location required " .
"as a command-line argument\n";
- $SVN_URL =~ s!/+$!!; # strip trailing slash
+ $url =~ s!/+$!!; # strip trailing slash
+
+ if (my $repo_path = shift) {
+ unless (-d $repo_path) {
+ mkpath([$repo_path]);
+ }
+ $GIT_DIR = $ENV{GIT_DIR} = $repo_path . "/.git";
+ init_vars();
+ }
+
+ $SVN_URL = $url;
unless (-d $GIT_DIR) {
my @init_db = ('git-init-db');
push @init_db, "--template=$_template" if defined $_template;