From c3e5417c172e44f49678376580d5dc1111be8519 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 19 Oct 2020 13:13:49 -0400 Subject: [PATCH] don't try to remove pre-commit-annex and post-update-annex-hooks Those are not installed by git-annex but by the user, and so removal will never find the default content, and so if the user did install them, it would display a misleading message. Seems better, since the user installed them, to let the user remove them if they want to. --- Annex/Hook.hs | 10 ---------- Annex/Init.hs | 6 +++++- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/Annex/Hook.hs b/Annex/Hook.hs index 69dca860b2..467c1f07da 100644 --- a/Annex/Hook.hs +++ b/Annex/Hook.hs @@ -18,16 +18,6 @@ import Utility.Shell import qualified Data.Map as M --- Remove all hooks. -unHook :: Annex () -unHook = do - hookUnWrite preCommitHook - hookUnWrite postReceiveHook - hookUnWrite postCheckoutHook - hookUnWrite postMergeHook - hookUnWrite preCommitAnnexHook - hookUnWrite postUpdateAnnexHook - preCommitHook :: Git.Hook preCommitHook = Git.Hook "pre-commit" (mkHookScript "git annex pre-commit .") [] diff --git a/Annex/Init.hs b/Annex/Init.hs index 4bcae34908..ac640fcf6e 100644 --- a/Annex/Init.hs +++ b/Annex/Init.hs @@ -145,7 +145,11 @@ initialize' mversion = checkCanInitialize $ do uninitialize :: Annex () uninitialize = do - unHook + -- Remove hooks that are written when initializing. + hookUnWrite preCommitHook + hookUnWrite postReceiveHook + hookUnWrite postCheckoutHook + hookUnWrite postMergeHook deconfigureSmudgeFilter removeRepoUUID removeVersion -- 2.30.2