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
7 changes: 6 additions & 1 deletion git-hooks/pre-push
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,12 @@ while read -r local_ref local_sha _ remote_sha; do
if [ "$remote_sha" = "0000000000000000000000000000000000000000" ]; then
commits=$(git rev-list "$local_sha" --not --all)
else
commits=$(git rev-list "$local_sha" --not "$remote_sha")
default_remote_ref=$(git symbolic-ref -q --short "refs/remotes/$remote_name/HEAD" || true)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cargo was needed for this dotfiles repo because its own lint and pre-push checks run cargo fmt and cargo clippy. The browser repo did not need Cargo for the Android PR; that earlier failure exposed this shared hook range issue, and this source repo is the right place to fix it so future installed hooks do not validate commits already on the remote default branch.

if [ -n "$default_remote_ref" ]; then
commits=$(git rev-list "$local_sha" --not "$remote_sha" "$default_remote_ref")
else
commits=$(git rev-list "$local_sha" --not "$remote_sha")
fi
fi

echo "🔎 Checking commits for $local_ref..."
Expand Down
Loading