commits with multiple parents were not being detected.
break long shell command across two lines
ISSUE-ID: RELENG-2685
Signed-off-by: Aric Gardner <agardner@linuxfoundation.org>
Change-Id: I660fabfba0497ab4c6825853c0fa117bacc93581
Signed-off-by: Lott, Christopher (cl778h) <cl778h@att.com>
--- /dev/null
+---
+fixes:
+ - |
+ Fix release file detection on commit with multiple parents
NEXUS_PATH="${SILO}/${JENKINS_HOSTNAME}/"
# Verify if using release file or parameters
if $USE_RELEASE_FILE ; then
NEXUS_PATH="${SILO}/${JENKINS_HOSTNAME}/"
# Verify if using release file or parameters
if $USE_RELEASE_FILE ; then
- release_files=$(git diff-tree -m --no-commit-id -r "$GIT_COMMIT" --name-only -- "releases/" ".releases/")
+ release_files=$(git diff-tree -m --no-commit-id -r "$GIT_COMMIT" "$GIT_COMMIT^1" \
+ --name-only -- "releases/" ".releases/")
if (( $(grep -c . <<<"$release_files") > 1 )); then
echo "INFO: RELEASE FILES ARE AS FOLLOWS: $release_files"
if (( $(grep -c . <<<"$release_files") > 1 )); then
echo "INFO: RELEASE FILES ARE AS FOLLOWS: $release_files"
- echo "ERROR: Committing multiple release files in the same commit OR rename/amend of existing files is not supported."
+ echo "ERROR: Adding multiple release files in the same commit"
+ echo "ERROR: OR rename/amend/delete of existing files is not supported."
exit 1
else
release_file="$release_files"
exit 1
else
release_file="$release_files"