Browse Source

Pass in appropriate relative path when executing hooks.

Jelmer Vernooij 2 years ago
parent
commit
529845f7ba
1 changed files with 3 additions and 1 deletions
  1. 3 1
      dulwich/hooks.py

+ 3 - 1
dulwich/hooks.py

@@ -100,7 +100,9 @@ class ShellHook(Hook):
             args = self.pre_exec_callback(*args)
 
         try:
-            ret = subprocess.call([self.filepath] + list(args), cwd=self.cwd)
+            ret = subprocess.call(
+                [os.path.relpath(self.filepath, self.cwd)] + list(args),
+                cwd=self.cwd)
             if ret != 0:
                 if self.post_exec_callback is not None:
                     self.post_exec_callback(0, *args)