From 0e8d158a1ae5efd236bc5b94a99b9a74de8c858d Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Jun 08 2014 14:06:47 +0000 Subject: Handle the situation where the email hook was not properly installed and we try to remove it --- 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)