don't warn about existence of pre-commit hook if it already has the right content
This commit is contained in:
parent
ba0c165704
commit
90d44f09eb
1 changed files with 4 additions and 1 deletions
5
Init.hs
5
Init.hs
|
@ -86,7 +86,10 @@ gitPreCommitHookWrite :: Annex ()
|
||||||
gitPreCommitHookWrite = unlessBare $ do
|
gitPreCommitHookWrite = unlessBare $ do
|
||||||
hook <- preCommitHook
|
hook <- preCommitHook
|
||||||
ifM (liftIO $ doesFileExist hook)
|
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 $
|
, unlessM crippledFileSystem $
|
||||||
liftIO $ do
|
liftIO $ do
|
||||||
viaTmp writeFile hook preCommitScript
|
viaTmp writeFile hook preCommitScript
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue