project: Ignore failure to remove the sample hooks

Removing the sample hooks is just clean up, so if repo cannot remove a
sample hook that should not cause it to fail.

Change-Id: I716b977da091c22b8f53e134f4fbc114116f9a65
Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/328635
Reviewed-by: Mike Frysinger <vapier@google.com>
This commit is contained in:
Peter Kjellerstedt 2022-01-21 23:09:19 +01:00 committed by Mike Frysinger
parent a535ae4418
commit b550501254

View File

@ -2554,7 +2554,10 @@ class Project(object):
# Delete sample hooks. They're noise.
for hook in glob.glob(os.path.join(hooks, '*.sample')):
try:
platform_utils.remove(hook, missing_ok=True)
except PermissionError:
pass
for stock_hook in _ProjectHooks():
name = os.path.basename(stock_hook)