X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=git-cvsexportcommit.perl;h=f284c88a46b5cc7d6e75b78346829ce03e60b060;hb=5153399c9b0c0e38d00877c4a78248eefeba7ad3;hp=7a955d4530611674c1d6650ce00dd4ff65cf15bc;hpb=de61e42b539ffbd28d2a2ba827bb0eb79767057b;p=git.git diff --git a/git-cvsexportcommit.perl b/git-cvsexportcommit.perl index 7a955d453..f284c88a4 100755 --- a/git-cvsexportcommit.perl +++ b/git-cvsexportcommit.perl @@ -219,6 +219,17 @@ print "Applying\n"; print "Patch applied successfully. Adding new files and directories to CVS\n"; my $dirtypatch = 0; + +# +# We have to add the directories in order otherwise we will have +# problems when we try and add the sub-directory of a directory we +# have not added yet. +# +# Luckily this is easy to deal with by sorting the directories and +# dealing with the shortest ones first. +# +@dirs = sort { length $a <=> length $b} @dirs; + foreach my $d (@dirs) { if (system(@cvs,'add',$d)) { $dirtypatch = 1;