| |
@@ -4489,9 +4489,15 @@
|
| |
specfile_path = os.path.relpath(specfile_path_absolute, start=self.path)
|
| |
cmd = ['spectool', '-l', os.path.join(clone_dir, specfile_path)]
|
| |
# extract just '--define' arguments from rpmdefines
|
| |
- for opt, val in zip(self.rpmdefines[0::2], self.rpmdefines[1::2]):
|
| |
- if opt == '--define':
|
| |
- cmd.extend((opt, val))
|
| |
+ try:
|
| |
+ for opt, val in zip(self.rpmdefines[0::2], self.rpmdefines[1::2]):
|
| |
+ if opt == '--define':
|
| |
+ cmd.extend((opt, val))
|
| |
+ except rpkgError:
|
| |
+ # this exception was caused probably by using a private branch
|
| |
+ self.log.warning('The pre-push script can\'t check private branches. '
|
| |
+ 'Push operation continues.')
|
| |
+ return
|
| |
ret, stdout, _ = self._run_command(cmd, cwd=clone_dir,
|
| |
return_text=True, return_stdout=True)
|
| |
if ret != 0:
|
| |
The pre-push hook script was failing the when user tried to push
a private branch. It required using the --release argument with
the pre-push-check command and passing additional arguments into
the hook script. That was found unreliable and private branches
won't be checked.
Fixes: #683
JIRA: RHELCMP-11528
Signed-off-by: Ondrej Nosek onosek@redhat.com