mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-24 04:13:28 +01:00
pre-push.git-hook: Check remote name to see if it's upstream
This commit is contained in:
parent
d91deeee45
commit
6f1527f888
@ -16,6 +16,7 @@ echo "Running pre-push hook"
|
|||||||
|
|
||||||
z40=0000000000000000000000000000000000000000
|
z40=0000000000000000000000000000000000000000
|
||||||
|
|
||||||
|
upstream_name=${TOR_UPSTREAM_REMOTE_NAME:-"upstream"}
|
||||||
|
|
||||||
workdir=$(git rev-parse --show-toplevel)
|
workdir=$(git rev-parse --show-toplevel)
|
||||||
if [ -x "$workdir/.git/hooks/pre-commit" ]; then
|
if [ -x "$workdir/.git/hooks/pre-commit" ]; then
|
||||||
@ -33,8 +34,9 @@ fi
|
|||||||
remote="$1"
|
remote="$1"
|
||||||
remote_loc="$2"
|
remote_loc="$2"
|
||||||
|
|
||||||
if [[ "$remote_loc" != *github.com/torproject/tor.git ]] &&
|
remote_name=$(git remote --verbose | grep "$2" | awk '{print $1}' | head -n 1)
|
||||||
[[ "$remote_loc" != *torproject.org/tor.git ]]; then
|
|
||||||
|
if [[ "$remote_name" != "$upstream_name" ]]; then
|
||||||
echo "Not pushing to upstream - refraining from further checks"
|
echo "Not pushing to upstream - refraining from further checks"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user