summaryrefslogtreecommitdiff
path: root/Command/Init.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-06-22 18:32:41 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-06-22 18:32:41 -0400
commit80302d0b46c5d45df1cf290796e0e27d9264ece8 (patch)
treec97312a531f5cf2ef514ddb5224395b614eb2b25 /Command/Init.hs
parent944c51ba26efc39416c5f148b6ec36151dc7f42e (diff)
improve bare repo handing
Many more commands can work in bare repos now, thanks to the git-annex branch.
Diffstat (limited to 'Command/Init.hs')
-rw-r--r--Command/Init.hs5
1 files changed, 3 insertions, 2 deletions
diff --git a/Command/Init.hs b/Command/Init.hs
index df416eed3..7f5773117 100644
--- a/Command/Init.hs
+++ b/Command/Init.hs
@@ -8,7 +8,7 @@
module Command.Init where
import Control.Monad.State (liftIO)
-import Control.Monad (when)
+import Control.Monad (when, unless)
import System.Directory
import Command
@@ -44,7 +44,8 @@ perform description = do
u <- getUUID g
setVersion
describeUUID u description
- gitPreCommitHookWrite g
+ unless (Git.repoIsLocalBare g) $
+ gitPreCommitHookWrite g
next $ return True
{- set up a git pre-commit hook, if one is not already present -}