avoid writing pre-commit hook if we cannot make it executable
This commit is contained in:
parent
bff6c9f53f
commit
2b86dc0271
1 changed files with 5 additions and 4 deletions
9
Init.hs
9
Init.hs
|
@ -76,10 +76,11 @@ gitPreCommitHookWrite = unlessBare $ do
|
|||
hook <- preCommitHook
|
||||
ifM (liftIO $ doesFileExist hook)
|
||||
( warning $ "pre-commit hook (" ++ hook ++ ") already exists, not configuring"
|
||||
, liftIO $ do
|
||||
viaTmp writeFile hook preCommitScript
|
||||
p <- getPermissions hook
|
||||
setPermissions hook $ p {executable = True}
|
||||
, unlessM crippledFileSystem $
|
||||
liftIO $ do
|
||||
viaTmp writeFile hook preCommitScript
|
||||
p <- getPermissions hook
|
||||
setPermissions hook $ p {executable = True}
|
||||
)
|
||||
|
||||
gitPreCommitHookUnWrite :: Annex ()
|
||||
|
|
Loading…
Reference in a new issue