diff --git a/progit/hooks/mail.py b/progit/hooks/mail.py index f708cd1..f95f1e8 100644 --- a/progit/hooks/mail.py +++ b/progit/hooks/mail.py @@ -108,4 +108,6 @@ class Mail(BaseHook): repopath = os.path.join(APP.config['GIT_FOLDER'], project.path) if project.is_fork: repopath = os.path.join(APP.config['FORK_FOLDER'], project.path) - os.unlink(os.path.join(repopath, 'hooks', 'post-receive.mail')) + hook_path = os.path.join(repopath, 'hooks', 'post-receive.mail') + if os.path.exists(hook_path): + os.unlink(hook_path)