diff --git a/gclient.py b/gclient.py index c096492c1..ddc36acd5 100755 --- a/gclient.py +++ b/gclient.py @@ -897,8 +897,9 @@ class Dependency(gclient_utils.WorkItem, DependencySettings): hooks_cwd = self.root.root_dir if self._use_relative_paths: hooks_cwd = os.path.join(hooks_cwd, self.name) - logging.warning('Updating hook base working directory to %s.', - hooks_cwd) + elif self._relative: + hooks_cwd = os.path.join(hooks_cwd, os.path.dirname(self.name)) + logging.warning('Using hook base working directory: %s.', hooks_cwd) # Only add all hooks if we should sync, otherwise just add custom hooks. # override named sets of hooks by the custom hooks diff --git a/tests/gclient_test.py b/tests/gclient_test.py index 5de4c8d36..06d6fdd58 100755 --- a/tests/gclient_test.py +++ b/tests/gclient_test.py @@ -451,7 +451,7 @@ class GclientTest(trial_dir.TestCase): self.assertEqual( [(h.action, h.effective_cwd) for h in self._get_hooks()], - [(('tata', 'titi'), self.root_dir), + [(('tata', 'titi'), os.path.join(self.root_dir, 'foo')), (('fire', 'lazors'), os.path.join(self.root_dir, 'foo/baz'))]) def testTargetOS(self):