From 2632f0bd0e013e7b102ae435048456bdcf66607a Mon Sep 17 00:00:00 2001 From: Joe Chacko <143064+joe-chacko@users.noreply.github.com> Date: Fri, 31 May 2024 16:52:49 +0100 Subject: [PATCH] OPS: fix copyright check --- scripts/check-copyright.sh | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/scripts/check-copyright.sh b/scripts/check-copyright.sh index ff8da61b..a58ac167 100755 --- a/scripts/check-copyright.sh +++ b/scripts/check-copyright.sh @@ -92,14 +92,9 @@ FAILED=$((FAILED + $(git diff --name-only --find-copies-harder --diff-filter=AM # This is apparently due to metadata changes. Shrug. # So check whether the contents have changed significantly. -# Define how to compare a file against its origin for significant content changes -isReallyDifferent() { - if git diff --ignore-all-space --quiet "$1" "$2" 2>/dev/null; then - echo "$2" - else - return 1; - fi -} +# Define how to compare a file against its origin for significant content changes. +# Succeed if there are differences, and print the filename. +isReallyDifferent() { ! git diff --ignore-all-space --quiet "$1" "$2" 2>/dev/null && echo "$2"; } # Read status, source, and destination as separate records (lines). # Check the status is R... or C... (otherwise it was parsed incorrectly).