From 1de1f9b8732dcc9378fe0397b58375671b6fc3ff Mon Sep 17 00:00:00 2001 From: Sasha Levin Date: Fri, 20 Dec 2024 09:37:25 -0500 Subject: [PATCH] dropped_commits.sh: fix awk compatibility Signed-off-by: Sasha Levin --- scripts/dropped_commits.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/dropped_commits.sh b/scripts/dropped_commits.sh index 9b9e7f8a23f..777c5e05649 100755 --- a/scripts/dropped_commits.sh +++ b/scripts/dropped_commits.sh @@ -8,16 +8,16 @@ extract_sha1() { local content="$1" # Skip everything until the first blank line (end of commit metadata) # Then look for first 40-character hex string - awk ' + echo "$content" | awk ' BEGIN { found_blank = 0 } /^$/ { found_blank = 1; next } found_blank == 1 { - if (match($0, /[0-9a-f]{40}/, m)) { - print m[0] + if (match($0, /[0-9a-f]{40}/)) { + print substr($0, RSTART, RLENGTH) exit } } - ' <<< "$content" || echo "NO_SHA" + ' || echo "NO_SHA" } # Function to check if a file was moved rather than deleted -- 2.47.2