diff options
author | Joey Hess <joey@kitenet.net> | 2013-05-17 15:59:03 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2013-05-17 15:59:03 -0400 |
commit | 963f2c5726ce0fe899038733d4318a234d355268 (patch) | |
tree | f3201eec365ac89d33e6b51b2036dea0a12e4ec0 /Init.hs | |
parent | 6cb343f95e15aa52ec1a32b5ae1154ccdf4f6e62 (diff) |
don't warn about existence of pre-commit hook if it already has the right content
Diffstat (limited to 'Init.hs')
-rw-r--r-- | Init.hs | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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 |