Skip to content

Commit

Permalink
project: prune sample hooks
Browse files Browse the repository at this point in the history
These hooks are never used and often get stale, so just trim them.
Users rarely look in these dirs to begin with.

Change-Id: Ic785aa55fb7ec84a61376df101127d0018882030
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/327538
Reviewed-by: Jack Neus <[email protected]>
Tested-by: Mike Frysinger <[email protected]>
  • Loading branch information
vapier committed Jan 10, 2022
1 parent d33dce0 commit 98bb765
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions project.py
Original file line number Diff line number Diff line change
Expand Up @@ -2548,6 +2548,11 @@ def _InitHooks(self, quiet=False):
hooks = platform_utils.realpath(os.path.join(self.objdir, 'hooks'))
if not os.path.exists(hooks):
os.makedirs(hooks)

# Delete sample hooks. They're noise.
for hook in glob.glob(os.path.join(hooks, '*.sample')):
platform_utils.remove(hook, missing_ok=True)

for stock_hook in _ProjectHooks():
name = os.path.basename(stock_hook)

Expand Down

0 comments on commit 98bb765

Please sign in to comment.