Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions scripts/git-hooks/pre-push
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ while read -r local_ref local_sha remote_ref remote_sha; do
echo "pre-push: UNCHECKED: git diff $diff_from $local_sha failed for $local_ref; $bypass" >&2
exit 1
fi
mapfile -d '' files <"$names"
files=(); while IFS= read -r -d '' _path; do files+=("$_path"); done <"$names"
if [[ ${#files[@]} -eq 0 ]]; then
continue
fi
Expand All @@ -173,7 +173,7 @@ while read -r local_ref local_sha remote_ref remote_sha; do
if old_diff_from=$(git merge-base "$base_ref" "$remote_sha" 2>/dev/null); then
old_names=$(mktemp)
if git diff --name-only -z "$old_diff_from" "$remote_sha" >"$old_names"; then
mapfile -d '' old_files <"$old_names"
old_files=(); while IFS= read -r -d '' _path; do old_files+=("$_path"); done <"$old_names"
if [[ ${#old_files[@]} -eq 0 ]]; then
old_rc=0
else
Expand All @@ -182,7 +182,7 @@ while read -r local_ref local_sha remote_ref remote_sha; do
if [[ $old_rc -eq 1 ]]; then
delta_names=$(mktemp)
if git diff --name-only -z "$remote_sha" "$local_sha" >"$delta_names"; then
mapfile -d '' delta_files <"$delta_names"
delta_files=(); while IFS= read -r -d '' _path; do delta_files+=("$_path"); done <"$delta_names"
if [[ ${#delta_files[@]} -eq 0 ]]; then
continue
fi
Expand Down
Loading