pre-upload: Filter out enabled hooks from common hook list

Otherwise some hooks (such as cros_license_check) would run twice when
enabled with custom options, the second run without the requested
options.

Also refactor some of the code to make it cleaner.

BUG=chromium:541707
TEST=Ran a presubmit with cros_license_check options successfully.

Change-Id: I80e9d290434f42ed7927d175fbad153950678c4a
Signed-off-by: Filipe Brandenburger <filbranden@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/304869
Reviewed-by: Mike Frysinger <vapier@chromium.org>
1 file changed