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