diff options
author | Eric Wong <normalperson@yhbt.net> | 2006-05-03 22:54:00 -0700 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2006-06-16 03:04:20 -0700 |
commit | 6dfbe5163e26e3e1126c9b08c3cb38195e92a82c (patch) | |
tree | 513c9642e238b850ab5cee630eb3659fb3f7623a /contrib | |
parent | 098749d9bee6694abc8a0991996ff94b607abc7f (diff) | |
download | git-6dfbe5163e26e3e1126c9b08c3cb38195e92a82c.tar.gz git-6dfbe5163e26e3e1126c9b08c3cb38195e92a82c.tar.xz |
git-svn: support manually placed initial trees from fetch
Sometimes I don't feel like downloading an entire tree again when
I actually decide a branch is worth tracking, so some users can
get around it more easily with this.
Signed-off-by: Eric Wong <normalperson@yhbt.net>
Diffstat (limited to 'contrib')
-rwxr-xr-x | contrib/git-svn/git-svn.perl | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/contrib/git-svn/git-svn.perl b/contrib/git-svn/git-svn.perl index d4b932369..54f3d6312 100755 --- a/contrib/git-svn/git-svn.perl +++ b/contrib/git-svn/git-svn.perl @@ -262,7 +262,14 @@ sub fetch { } else { chdir $SVN_WC or croak $!; read_uuid(); - $last_commit = file_to_s("$REV_DIR/$base->{revision}"); + eval { $last_commit = file_to_s("$REV_DIR/$base->{revision}") }; + # looks like a user manually cp'd and svn switch'ed + unless ($last_commit) { + sys(qw/svn revert -R ./); + assert_svn_wc_clean($base->{revision}); + $last_commit = git_commit($base, @parents); + assert_tree($last_commit); + } } my @svn_up = qw(svn up); push @svn_up, '--ignore-externals' unless $_no_ignore_ext; |