meta:hooks:pre-push: Refactor if-condition
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user