aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-08-17 18:42:49 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-08-17 18:42:49 -0400
commit9e763954ae96201ce577cb51f904bf7756597f14 (patch)
tree01127e5183e06b1322305881644ac67dfb41c14c
parentb7a4ff1c3185404d36d34b372b016be052394a95 (diff)
tweak
-rw-r--r--Init.hs10
1 files changed, 4 insertions, 6 deletions
diff --git a/Init.hs b/Init.hs
index ae92998bb..a11a7c51c 100644
--- a/Init.hs
+++ b/Init.hs
@@ -1,6 +1,6 @@
{- git-annex repository initialization
-
- - Copyright 2010 Joey Hess <joey@kitenet.net>
+ - Copyright 2011 Joey Hess <joey@kitenet.net>
-
- Licensed under the GNU GPL version 3 or higher.
-}
@@ -43,11 +43,9 @@ uninitialize = do
to avoid git-annex accidentially being run in git
repos that did not intend to use it. -}
ensureInitialized :: Annex ()
-ensureInitialized = do
- v <- getVersion
- case v of
- Just version -> checkVersion version
- Nothing -> do
+ensureInitialized = getVersion >>= maybe needsinit checkVersion
+ where
+ needsinit = do
annexed <- Branch.hasSomeBranch
if annexed
then initialize