aboutsummaryrefslogtreecommitdiff
path: root/git-svnimport.perl
diff options
context:
space:
mode:
authorSasha Khapyorsky <sashak@voltaire.com>2006-02-01 17:53:31 +0200
committerJunio C Hamano <junkio@cox.net>2006-02-01 14:23:47 -0800
commitd9e2e12700e403ae5fc11193dd6e91546abd5809 (patch)
tree9d1a9aadd2377fa9542d15e97ca4c7ecf3060bf7 /git-svnimport.perl
parentcb754fdf5a742a5479458da84d8f92bce2434ed5 (diff)
downloadgit-d9e2e12700e403ae5fc11193dd6e91546abd5809.tar.gz
git-d9e2e12700e403ae5fc11193dd6e91546abd5809.tar.xz
git-svnimport.perl: fix for 'arg list too long...'
This fixes 'arg list too long..' problem with git-ls-files. Note that second arg list separation loop (with 'git-update-index') is needed since git-ls-files arguments can be directories. Signed-off-by: Sasha Khapyorsky <sashak@voltaire.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'git-svnimport.perl')
-rwxr-xr-xgit-svnimport.perl25
1 files changed, 16 insertions, 9 deletions
diff --git a/git-svnimport.perl b/git-svnimport.perl
index 6e3a44a2b..b6799d81e 100755
--- a/git-svnimport.perl
+++ b/git-svnimport.perl
@@ -546,23 +546,30 @@ sub commit {
}
}
- if(@old) {
- open my $F, "-|", "git-ls-files", "-z", @old or die $!;
- @old = ();
+ while(@old) {
+ my @o1;
+ if(@old > 55) {
+ @o1 = splice(@old,0,50);
+ } else {
+ @o1 = @old;
+ @old = ();
+ }
+ open my $F, "-|", "git-ls-files", "-z", @o1 or die $!;
+ @o1 = ();
local $/ = "\0";
while(<$F>) {
chomp;
- push(@old,$_);
+ push(@o1,$_);
}
close($F);
- while(@old) {
+ while(@o1) {
my @o2;
- if(@old > 55) {
- @o2 = splice(@old,0,50);
+ if(@o1 > 55) {
+ @o2 = splice(@o1,0,50);
} else {
- @o2 = @old;
- @old = ();
+ @o2 = @o1;
+ @o1 = ();
}
system("git-update-index","--force-remove","--",@o2);
die "Cannot remove files: $?\n" if $?;