Skip to content
Snippets Groups Projects

Issue #3365151: CollectPathsToExcludeEvent needs to exclude paths relative to the project root prefixed with './' so they are not ambiguous to rsync

Merged Issue #3365151: CollectPathsToExcludeEvent needs to exclude paths relative to the project root prefixed with './' so they are not ambiguous to rsync
1 file
+ 11
5
Compare changes
  • Side-by-side
  • Inline
@@ -105,12 +105,18 @@ final class CollectPathsToExcludeEvent extends StageEvent implements PathListInt
@@ -105,12 +105,18 @@ final class CollectPathsToExcludeEvent extends StageEvent implements PathListInt
// Make absolute paths relative to the project root, prefixed with `./`
// Make absolute paths relative to the project root, prefixed with `./`
// so that they're totally unambiguous. A path like
// so that they're totally unambiguous. A path like
// `/path/to/project/file.php` should become `/file.php`.
// `/path/to/project/file.php` should become `/file.php`.
$path = str_replace($project_root, '', $path);
$flag = TRUE;
if ($path[0] == '/') {
if (is_file($path)) {
$path = '.' . $path;
$flag = FALSE;
}
}
else {
$path = str_replace($project_root, '', $path);
$path = './' . $path;
if ($flag) {
 
if ($path[0] == '/') {
 
$path = '.' . $path;
 
}
 
else {
 
$path = './' . $path;
 
}
}
}
$this->add([$path]);
$this->add([$path]);
}
}
Loading