mirror of
https://github.com/git/git.git
synced 2024-05-13 13:26:08 +02:00
Ensure we add directories in the correct order
CVS gets understandably upset if you try and add a subdirectory before it's parent directory. This patch fixes that. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
This commit is contained in:
parent
42a32174b6
commit
fd0b9594d0
|
@ -224,6 +224,17 @@
|
||||||
|
|
||||||
print "Patch applied successfully. Adding new files and directories to CVS\n";
|
print "Patch applied successfully. Adding new files and directories to CVS\n";
|
||||||
my $dirtypatch = 0;
|
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) {
|
foreach my $d (@dirs) {
|
||||||
if (system(@cvs,'add',$d)) {
|
if (system(@cvs,'add',$d)) {
|
||||||
$dirtypatch = 1;
|
$dirtypatch = 1;
|
||||||
|
|
Loading…
Reference in New Issue