summaryrefslogtreecommitdiff
path: root/Init.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-07-31 16:19:24 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-07-31 16:19:24 -0400
commitbcf5c81593f26a253b514224e3326defd6fa0a8d (patch)
tree70d65ead2eb53216200acd02b0f199da3c38cc61 /Init.hs
parentc70496dc7f89f07e05bea0257b7d93986dd61d89 (diff)
when run in uninitialized git repo, do firstrun
My $HOME is in git, let's make it work :)
Diffstat (limited to 'Init.hs')
-rw-r--r--Init.hs5
1 files changed, 5 insertions, 0 deletions
diff --git a/Init.hs b/Init.hs
index bddcc696e..8c000cc41 100644
--- a/Init.hs
+++ b/Init.hs
@@ -7,6 +7,7 @@
module Init (
ensureInitialized,
+ isInitialized,
initialize,
uninitialize
) where
@@ -45,6 +46,10 @@ ensureInitialized = getVersion >>= maybe needsinit checkVersion
, error "First run: git-annex init"
)
+{- Checks if a repository is initialized. Does not check version for ugrade. -}
+isInitialized :: Annex Bool
+isInitialized = maybe Annex.Branch.hasSibling (const $ return True) =<< getVersion
+
{- set up a git pre-commit hook, if one is not already present -}
gitPreCommitHookWrite :: Annex ()
gitPreCommitHookWrite = unlessBare $ do