mirror of
https://chromium.googlesource.com/chromium/tools/depot_tools.git
synced 2026-01-11 18:51:29 +00:00
gclient: Handle missing .git/hooks directory
Change-Id: I5d1c43546bb4ac57b9bb57f47e9ef04f1b19bc0c Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4881087 Auto-Submit: Philipp Wollermann <philwo@google.com> Commit-Queue: Joanna Wang <jojwang@chromium.org> Reviewed-by: Joanna Wang <jojwang@chromium.org> Commit-Queue: Philipp Wollermann <philwo@google.com>
This commit is contained in:
committed by
LUCI CQ
parent
8572d4bdcd
commit
a45d2d4c90
@@ -2006,6 +2006,9 @@ it or fix the checkout.
|
||||
if not os.path.exists(git_dir):
|
||||
return
|
||||
|
||||
git_hooks_dir = os.path.join(git_dir, 'hooks')
|
||||
os.makedirs(git_hooks_dir, exist_ok=True)
|
||||
|
||||
hook = os.path.join(git_dir, 'hooks', 'pre-commit')
|
||||
if os.path.exists(hook):
|
||||
with open(hook, 'r') as f:
|
||||
|
||||
Reference in New Issue
Block a user