Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
git-svn: fix clone when a target directory has been specified
author
Eric Wong
<normalperson@yhbt.net>
Fri, 23 Feb 2007 09:26:26 +0000
(
01:26
-0800)
committer
Eric Wong
<normalperson@yhbt.net>
Fri, 23 Feb 2007 09:26:26 +0000
(
01:26
-0800)
Several bugs caused this to fail:
* GIT_DIR was set incorrectly after entering the target directory
* Avoid double chdir-ing when clone is called with an explicit path
* create target subdirectory *before* running git-init when using
the multi-init path
Signed-off-by: Eric Wong <normalperson@yhbt.net>
git-svn.perl
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
a0d7fe3
)
diff --git
a/git-svn.perl
b/git-svn.perl
index ea5afb7f8089732b0f2a1c2cb2eacf9632a245cd..a5c6eb9fec8bcb1f459b7e236e47119ea0a97c16 100755
(executable)
--- a/
git-svn.perl
+++ b/
git-svn.perl
@@
-276,7
+276,7
@@
sub init_subdir {
my $repo_path = shift or return;
mkpath([$repo_path]) unless -d $repo_path;
chdir $repo_path or die "Couldn't chdir to $repo_path: $!\n";
my $repo_path = shift or return;
mkpath([$repo_path]) unless -d $repo_path;
chdir $repo_path or die "Couldn't chdir to $repo_path: $!\n";
- $ENV{GIT_DIR} =
$repo_path . "/.git"
;
+ $ENV{GIT_DIR} =
'.git'
;
}
sub cmd_clone {
}
sub cmd_clone {
@@
-286,12
+286,8
@@
sub cmd_clone {
$url !~ m#^[a-z\+]+://#) {
$path = $url;
}
$url !~ m#^[a-z\+]+://#) {
$path = $url;
}
- warn "--path: $path\n" if defined $path;
$path = basename($url) if !defined $path || !length $path;
$path = basename($url) if !defined $path || !length $path;
- warn "++path: $path\n" if defined $path;
- mkpath([$path]);
- chdir $path or die "Couldn't chdir to $path\n";
- cmd_init(@_);
+ cmd_init($url, $path);
Git::SVN::fetch_all($Git::SVN::default_repo_id);
}
Git::SVN::fetch_all($Git::SVN::default_repo_id);
}
@@
-459,12
+455,12
@@
sub cmd_multi_init {
unless (defined $_trunk || defined $_branches || defined $_tags) {
usage(1);
}
unless (defined $_trunk || defined $_branches || defined $_tags) {
usage(1);
}
- do_git_init_db();
$_prefix = '' unless defined $_prefix;
if (defined $url) {
$url =~ s#/+$##;
init_subdir(@_);
}
$_prefix = '' unless defined $_prefix;
if (defined $url) {
$url =~ s#/+$##;
init_subdir(@_);
}
+ do_git_init_db();
if (defined $_trunk) {
my $trunk_ref = $_prefix . 'trunk';
# try both old-style and new-style lookups:
if (defined $_trunk) {
my $trunk_ref = $_prefix . 'trunk';
# try both old-style and new-style lookups: