summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Init.hs5
1 files changed, 4 insertions, 1 deletions
diff --git a/Init.hs b/Init.hs
index b66927435..6ddf36dc5 100644
--- a/Init.hs
+++ b/Init.hs
@@ -86,7 +86,10 @@ gitPreCommitHookWrite :: Annex ()
gitPreCommitHookWrite = unlessBare $ do
hook <- preCommitHook
ifM (liftIO $ doesFileExist hook)
- ( warning $ "pre-commit hook (" ++ hook ++ ") already exists, not configuring"
+ ( do
+ content <- readFile hook
+ when (content /= preCommitScript) $
+ warning $ "pre-commit hook (" ++ hook ++ ") already exists, not configuring"
, unlessM crippledFileSystem $
liftIO $ do
viaTmp writeFile hook preCommitScript