meta:hooks:pre-push: Refactor if-condition

This commit is contained in:
2022-07-12 20:46:43 +02:00
parent 45cb607385
commit e40ee88520

View File

@@ -27,10 +27,8 @@ url="$2"
zero=$(git hash-object --stdin </dev/null | tr '[0-9a-f]' '0')
while read local_ref local_oid remote_ref remote_oid; do
if [ "$local_oid" = "$zero" ]; then
# Handle delete
:
else
[ "$local_oid" != "$zero" ] || continue
if [ "$remote_oid" = "$zero" ]; then
# New branch, examine all commits
range="$local_oid"
@@ -48,7 +46,6 @@ while read local_ref local_oid remote_ref remote_oid; do
printf >&2 "Aborting push"
exit 1
fi
fi
done
exit 0