Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
REVIEW: Avoid looping to compute diff
Lorenz Leutgeb committed 25 days ago
commit 4999b763e687e466b1d30a049e1af80250728376
parent 240e6c55b667c127cc293ca9d81eba1fbc98fa6c
1 file changed +1 -6
modified scripts/git-hook-template.sh
@@ -18,12 +18,7 @@ if [ ${#CHANGED_FILES[@]} -gt 0 ]; then
    echo "Executing these hooks may run arbitrary code from the modified files."
    echo ""

-
    for file in "${CHANGED_FILES[@]}"; do
-
        echo "--- Diff for $file ---"
-
        git --no-pager diff "$BASE_BRANCH" -- "$file"
-
        echo "------------------------"
-
    done
-
    echo ""
+
    git --no-pager diff "$BASE_BRANCH" -- "${SENSITIVE_FILES[@]}"

    # Read from /dev/tty because stdin is not attached to the terminal in git hooks.
    exec < /dev/tty