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
|
hook <- preCommitHook
|
||||||
ifM (liftIO $ doesFileExist hook)
|
ifM (liftIO $ doesFileExist hook)
|
||||||
( warning $ "pre-commit hook (" ++ hook ++ ") already exists, not configuring"
|
( warning $ "pre-commit hook (" ++ hook ++ ") already exists, not configuring"
|
||||||
, liftIO $ do
|
, unlessM crippledFileSystem $
|
||||||
viaTmp writeFile hook preCommitScript
|
liftIO $ do
|
||||||
p <- getPermissions hook
|
viaTmp writeFile hook preCommitScript
|
||||||
setPermissions hook $ p {executable = True}
|
p <- getPermissions hook
|
||||||
|
setPermissions hook $ p {executable = True}
|
||||||
)
|
)
|
||||||
|
|
||||||
gitPreCommitHookUnWrite :: Annex ()
|
gitPreCommitHookUnWrite :: Annex ()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue