From d51458d7b45d64a03305f1d30684f788d5a1e3e7 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Thu, 4 Jul 2019 13:26:46 +0100 Subject: [PATCH] Add more difference infrastructure --- differences/dometahierarchy.groovy | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/differences/dometahierarchy.groovy b/differences/dometahierarchy.groovy index a58c02e..583c7f1 100644 --- a/differences/dometahierarchy.groovy +++ b/differences/dometahierarchy.groovy @@ -116,9 +116,11 @@ def getgitlogdifferences(String gitrootfolder, String earlyrevision, String late def extractsha(String line) { def pattern = ~"^(\\p{XDigit}*) (.*)" + def match = (line =~ pattern) + match.find() - def sha = line.replaceFirst(pattern) { _, shabit, therest -> "${shabit}" } - def restofline = line.replaceFirst(pattern) { _, shabit, therest -> "${therest}" } + def sha = match.group(1) + def restofline = match.group(2) echo "Sha filtering: line: ${line} sha: ${sha} therest: ${restofline}"