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.
This commit is contained in:
Joey Hess 2020-10-19 13:13:49 -04:00
parent b2c5c99506
commit c3e5417c17
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
2 changed files with 5 additions and 11 deletions

View file

@ -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 .") []

View file

@ -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