Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
git-hook-template: Avoid looping to compute diff
Lorenz Leutgeb committed 22 days ago
commit b5b77e2b63702d0c1d0099f569a26a72c5fbe39d
parent 2c7edd88c5b6d2da68cac00142acb9d32b453175
1 file changed +1 -6
modified scripts/git-hook-template.sh
@@ -19,12 +19,7 @@ then
    echo "Executing this hook 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