From e51300f4d6e1290b35bc2b962d4d91cf60a97fbb Mon Sep 17 00:00:00 2001 From: jglick Date: Thu, 7 Dec 2006 21:47:39 +0000 Subject: [PATCH] #190: CVS update regression. git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@1256 71c3de6d-444a-0410-be80-ed276b4c234a --- core/src/main/java/hudson/scm/CVSSCM.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/hudson/scm/CVSSCM.java b/core/src/main/java/hudson/scm/CVSSCM.java index 6dd366ffc7..929d5095c2 100644 --- a/core/src/main/java/hudson/scm/CVSSCM.java +++ b/core/src/main/java/hudson/scm/CVSSCM.java @@ -278,9 +278,18 @@ public class CVSSCM extends AbstractCVSFamilySCM { // Add in any existing CVS dirs, in case project checked out its own. File[] subdirs = workspace.getLocal().listFiles(); if (subdirs != null) { - for (File s : subdirs) { + SUBDIR: for (File s : subdirs) { if (new File(s, "CVS").isDirectory()) { - moduleNames.add(s.getName()); + String top = s.getName(); + for (String mod : moduleNames) { + if (mod.startsWith(top + "/")) { + // #190: user asked to check out foo/bar foo/baz quux + // Our top-level dirs are "foo" and "quux". + // Do not add "foo" to checkout or we will check out foo/*! + continue SUBDIR; + } + } + moduleNames.add(top); } } }