aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/sonar-svn-plugin
diff options
context:
space:
mode:
authorJulien HENRY <julien.henry@sonarsource.com>2014-10-03 16:02:54 +0200
committerJulien HENRY <julien.henry@sonarsource.com>2014-10-03 16:07:33 +0200
commit6a2bbb248a9a192249fe6e4df1ad4c9444f8f78e (patch)
tree4ff657079e069cf3b36c4fb81e069ac315f97ede /plugins/sonar-svn-plugin
parent72e5ccaf03bb37e407ec0e0e4c7253f5060708da (diff)
downloadsonarqube-6a2bbb248a9a192249fe6e4df1ad4c9444f8f78e.tar.gz
sonarqube-6a2bbb248a9a192249fe6e4df1ad4c9444f8f78e.zip
SONAR-5620 Minor fixes
Diffstat (limited to 'plugins/sonar-svn-plugin')
-rw-r--r--plugins/sonar-svn-plugin/src/main/java/org/sonar/plugins/scm/svn/SvnBlameCommand.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/plugins/sonar-svn-plugin/src/main/java/org/sonar/plugins/scm/svn/SvnBlameCommand.java b/plugins/sonar-svn-plugin/src/main/java/org/sonar/plugins/scm/svn/SvnBlameCommand.java
index 4a9f2ba0e27..fed32b126b1 100644
--- a/plugins/sonar-svn-plugin/src/main/java/org/sonar/plugins/scm/svn/SvnBlameCommand.java
+++ b/plugins/sonar-svn-plugin/src/main/java/org/sonar/plugins/scm/svn/SvnBlameCommand.java
@@ -26,6 +26,7 @@ import org.sonar.api.batch.InstantiationStrategy;
import org.sonar.api.batch.fs.FileSystem;
import org.sonar.api.batch.fs.InputFile;
import org.sonar.api.batch.scm.BlameCommand;
+import org.sonar.api.batch.scm.BlameLine;
import org.sonar.api.utils.command.Command;
import org.sonar.api.utils.command.CommandExecutor;
import org.sonar.api.utils.command.StreamConsumer;
@@ -89,7 +90,12 @@ public class SvnBlameCommand implements BlameCommand, BatchComponent {
if (exitCode != 0) {
throw new IllegalStateException("The svn blame command [" + cl.toString() + "] failed: " + stderr.getOutput());
}
- result.add(inputFile, consumer.getLines());
+ List<BlameLine> lines = consumer.getLines();
+ if (lines.size() == inputFile.lines() - 1) {
+ // SONARPLUGINS-3097 SVN do not report blame on last empty line
+ lines.add(lines.get(lines.size() - 1));
+ }
+ result.add(inputFile, lines);
return null;
}
});