summaryrefslogtreecommitdiff
path: root/Init.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-02-18 15:52:50 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-02-18 15:52:50 -0400
commit6af0317a8181fb17375e179f70494c910d888215 (patch)
treede7888c67b07154a174fabbfe4d159b9f73445d1 /Init.hs
parent0aa111cf19ad25d947e4cb8f743db8590064a24b (diff)
avoid writing pre-commit hook if we cannot make it executable
Diffstat (limited to 'Init.hs')
-rw-r--r--Init.hs9
1 files changed, 5 insertions, 4 deletions
diff --git a/Init.hs b/Init.hs
index 4fbeabe01..3f4a9d385 100644
--- a/Init.hs
+++ b/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 ()