mirror of
https://github.com/SAP/jenkins-library.git
synced 2024-12-12 10:55:20 +02:00
[fix] Do not fail scanning for ChangeDocumentId/TransportRequestId in case of CR/LF
scanning for ChangeDocumentId/TransportRequestId failed when the commit message used CR/LF as line separator
This commit is contained in:
parent
5cec21fe3b
commit
0a53252a5a
@ -48,12 +48,21 @@ String[] extractLogLines(
|
||||
if(! to?.trim()) throw new IllegalArgumentException('Parameter \'to\' not provided.')
|
||||
if(! format?.trim()) throw new IllegalArgumentException('Parameter \'format\' not provided.')
|
||||
|
||||
sh ( returnStdout: true,
|
||||
def gitLogLines = sh ( returnStdout: true,
|
||||
script: """#!/bin/bash
|
||||
git log --pretty=format:${format} ${from}..${to}
|
||||
"""
|
||||
)?.split('\n')
|
||||
?.findAll { line -> line ==~ /${filter}/ }
|
||||
|
||||
// spread not supported here (CPS)
|
||||
if(gitLogLines) {
|
||||
def trimmedGitLogLines = []
|
||||
for(def gitLogLine : gitLogLines) {
|
||||
trimmedGitLogLines << gitLogLine.trim()
|
||||
}
|
||||
return trimmedGitLogLines.findAll { line -> line ==~ /${filter}/ }
|
||||
}
|
||||
return new String[0]
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user