path: root/git-cvsexportcommit.perl
diff options
authorShawn O. Pearce <>2007-10-19 05:18:55 (GMT)
committerShawn O. Pearce <>2007-10-19 05:18:55 (GMT)
commitf5bf6feb05b8c89c448ded6e6fad0eb58ef35463 (patch)
tree9f166b46e5005a38d0aeb59a9b4880b508578688 /git-cvsexportcommit.perl
parentd7e56dbc4f60f6bd238e8612783541d89f006fb7 (diff)
parentbbaf63f2f18242484868d6c03d5df9bd071d6deb (diff)
Merge branch 'maint'
* maint: Further fixes described in release notes Avoid invoking diff drivers during git-stash attr: fix segfault in gitattributes parsing code Define NI_MAXSERV if not defined by operating system Ensure we add directories in the correct order Avoid scary errors about tagged trees/blobs during git-fetch
Diffstat (limited to 'git-cvsexportcommit.perl')
1 files changed, 11 insertions, 0 deletions
diff --git a/git-cvsexportcommit.perl b/git-cvsexportcommit.perl
index 7a955d4..f284c88 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;