when run in uninitialized git repo, do firstrun

My $HOME is in git, let's make it work :)
This commit is contained in:
Joey Hess 2012-07-31 16:19:24 -04:00
parent c70496dc7f
commit bcf5c81593
2 changed files with 11 additions and 4 deletions

View file

@ -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