Skip to content

Commit 20147cf

Browse files
committed
do not log warning if the command actually worked
1 parent d705469 commit 20147cf

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

opengrok-indexer/src/main/java/org/opengrok/indexer/history/MercurialRepository.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -540,8 +540,10 @@ boolean isNestable() {
540540
private static boolean isHgWorking() {
541541
String repoCommand = getCommand(MercurialRepository.class, CMD_PROPERTY_KEY, CMD_FALLBACK);
542542
boolean works = checkCmd(repoCommand);
543-
LOGGER.log(Level.WARNING, "Command ''{0}'' does not work. " +
544-
"Some operations with Mercurial repositories will fail as a result.", repoCommand);
543+
if (!works) {
544+
LOGGER.log(Level.WARNING, "Command ''{0}'' does not work. " +
545+
"Some operations with Mercurial repositories will fail as a result.", repoCommand);
546+
}
545547
return works;
546548
}
547549

opengrok-indexer/src/main/java/org/opengrok/indexer/history/PerforceRepository.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,10 @@ boolean isRepositoryFor(File file, CommandTimeoutType cmdType) {
211211
private static boolean isP4Working() {
212212
String repoCommand = getCommand(PerforceRepository.class, CMD_PROPERTY_KEY, CMD_FALLBACK);
213213
boolean works = checkCmd(repoCommand, "-V");
214-
LOGGER.log(Level.WARNING, "Command ''{0}'' does not work. " +
215-
"Some operations with Perforce repositories will fail as a result.", repoCommand);
214+
if (!works) {
215+
LOGGER.log(Level.WARNING, "Command ''{0}'' does not work. " +
216+
"Some operations with Perforce repositories will fail as a result.", repoCommand);
217+
}
216218
return works;
217219
}
218220

0 commit comments

Comments
 (0)