Skip to content

Commit 16704b2

Browse files
committed
Avoid to delete unexistent paths [JENKINS-37500]
Signed-off-by: Marco Nenciarini <marco.nenciarini@2ndquadrant.it> Signed-off-by: Giulio Calacoci <giulio.calacoci@2ndquadrant.it>
1 parent dcd8be1 commit 16704b2

File tree

1 file changed

+4
-2
lines changed
  • src/main/java/hudson/plugins/scm_sync_configuration/model

1 file changed

+4
-2
lines changed

src/main/java/hudson/plugins/scm_sync_configuration/model/ChangeSet.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,10 @@ public void registerPath(String path) {
5858
public void registerPathForDeletion(String path){
5959
// We should determine if path is a directory by watching scm path (and not hudson path) because in most of time,
6060
// when we are here, directory is already deleted in hudson hierarchy...
61-
boolean isDirectory = new Path(path).getScmFile().isDirectory();
62-
pathsToDelete.add(new Path(path, isDirectory));
61+
if(new Path(path).getScmFile().exists()) {
62+
boolean isDirectory = new Path(path).getScmFile().isDirectory();
63+
pathsToDelete.add(new Path(path, isDirectory));
64+
}
6365
}
6466

6567
public boolean isEmpty(){

0 commit comments

Comments
 (0)