12 lines
263 B
Bash
12 lines
263 B
Bash
#!/bin/bash
|
|
|
|
current_branch="$(git branch --show-current)"
|
|
for protected_branch in "main" "stable"; do
|
|
if [[ "$protected_branch" == "$current_branch" ]]; then
|
|
echo "ERROR: local branch $current_branch is protected"
|
|
exit 1
|
|
fi
|
|
done
|
|
|
|
exit 0
|