This repository has been archived by the owner on Oct 18, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/main' into nd-codeprehend-privac…
…ypass-with-noble-curves-2023-04-25
- Loading branch information
Showing
117 changed files
with
2,833 additions
and
6,968 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
auto-install-peers=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,23 @@ | ||
#!/bin/bash | ||
# Prevents force-pushing to master | ||
|
||
echo -e "Pre-push Hook: Checking branch name" | ||
|
||
BRANCH=$(git rev-parse --abbrev-ref HEAD) | ||
PROTECTED_BRANCHES="^(main|develop)" | ||
# Get refs list from STDIN | ||
REFS=$(cat) | ||
|
||
parent_pid=$PPID | ||
push_command='' | ||
|
||
until [[ "$push_command" == git* ]]; do | ||
push_command=$(ps -ocommand= -p $parent_pid) | ||
parent_pid=$(ps -o ppid= $parent_pid) | ||
# echo "command = $push_command" | ||
# Prevents pushing to protected branches | ||
|
||
# List of branches where push is not allowed | ||
protected_branches=("main" "develop") | ||
|
||
# Read the standard input provided by Git | ||
while read local_ref local_sha remote_ref remote_sha | ||
do | ||
# Iterate over the protected branches | ||
for branch in "${protected_branches[@]}" | ||
do | ||
# Check if we're pushing to a protected branch | ||
if [[ "$remote_ref" == *"refs/heads/$branch"* ]]; then | ||
echo -e "\n🚫 Cannot push to remote $branch branch, please create your own branch and use PR.\n" | ||
exit 1 | ||
fi | ||
done | ||
done | ||
|
||
if [[ -n $REFS && $REFS != *"$BRANCH"* && -z $SKIP_HUSKY_PRE_PUSH ]] | ||
then | ||
echo "\$push_command = $push_command" | ||
echo "\$BRANCH = $BRANCH" | ||
echo "\$REFS = $REFS" | ||
echo -e "\n🚫 You must use (git push origin $BRANCH)\n" && exit 1 | ||
fi | ||
|
||
if [[ "$BRANCH" =~ $PROTECTED_BRANCHES ]] | ||
then | ||
echo -e "\n🚫 Cannot push to remote $BRANCH branch, please create your own branch and use PR.\n" && exit 1 | ||
fi | ||
|
||
echo -e ">> Finished checking branch name" | ||
echo -e ">> Push allowed\n" | ||
|
||
exit 0 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.