Fixes incorrect warning "could not set executable flag"

This warning was triggered, when the change was successful. Of course,
this should be the other way.
This commit is contained in:
René Pfeuffer
2022-04-01 11:28:17 +02:00
parent de9984ae2c
commit 07afe4b439
2 changed files with 3 additions and 1 deletions

View File

@@ -0,0 +1,2 @@
- type: fixed
description: Incorrect log warning "could not set executable flag"

View File

@@ -164,7 +164,7 @@ public interface ModifyWorkerHelper extends ModifyCommand.Worker {
}
boolean executable = Files.isExecutable(targetFile);
Files.move(file.toPath(), targetFile, REPLACE_EXISTING);
if (targetFile.toFile().setExecutable(executable)) {
if (!targetFile.toFile().setExecutable(executable)) {
LOG.warn("could not set executable flag for file {}", targetFile);
}
addFileToScm(path, targetFile);