Răsfoiți Sursa

Return hook return code.

Jelmer Vernooij 4 ani în urmă
părinte
comite
040be04936
2 a modificat fișierele cu 3 adăugiri și 3 ștergeri
  1. 2 2
      dulwich/hooks.py
  2. 1 1
      dulwich/tests/test_repository.py

+ 2 - 2
dulwich/hooks.py

@@ -97,8 +97,8 @@ class ShellHook(Hook):
             if ret != 0:
                 if (self.post_exec_callback is not None):
                     self.post_exec_callback(0, *args)
-                raise HookError("Hook %s exited with non-zero status"
-                                % (self.name))
+                raise HookError("Hook %s exited with non-zero status %d"
+                                % (self.name, ret))
             if (self.post_exec_callback is not None):
                 return self.post_exec_callback(1, *args)
         except OSError:  # no file. silent failure.

+ 1 - 1
dulwich/tests/test_repository.py

@@ -650,7 +650,7 @@ exit 1
             author_timestamp=12345, author_timezone=0)
         expected_warning = UserWarning(
             'post-commit hook failed: Hook post-commit exited with '
-            'non-zero status',)
+            'non-zero status 1',)
         for w in warnings_list:
             if (type(w) == type(expected_warning) and
                     w.args == expected_warning.args):