diff options
author | Joey Hess <joey@kitenet.net> | 2011-11-07 16:13:06 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2011-11-07 16:13:06 -0400 |
commit | 64bc4e4751c5738d3e6c44db9452c46b26245910 (patch) | |
tree | ca516271e093dd9543c076ff97b1c3e32c4740e8 | |
parent | 63a292324d20832b68c92f784828e55e644481cc (diff) |
refactor
-rw-r--r-- | Command/Init.hs | 6 | ||||
-rw-r--r-- | Init.hs | 9 |
2 files changed, 6 insertions, 9 deletions
diff --git a/Command/Init.hs b/Command/Init.hs index e2a6eb7b0..a6d72e422 100644 --- a/Command/Init.hs +++ b/Command/Init.hs @@ -9,8 +9,6 @@ module Command.Init where import Common.Annex import Command -import Annex.UUID -import Logs.UUID import Init def :: [Command] @@ -29,7 +27,5 @@ start ws = do perform :: String -> CommandPerform perform description = do - initialize - u <- getUUID - describeUUID u description + initialize (Just description) next $ return True @@ -19,13 +19,14 @@ import Logs.UUID import Annex.Version import Annex.UUID -initialize :: Annex () -initialize = do +initialize :: Maybe String -> Annex () +initialize mdescription = do prepUUID Annex.Branch.create setVersion gitPreCommitHookWrite - getUUID >>= recordUUID + u <- getUUID + maybe (recordUUID u) (describeUUID u) mdescription uninitialize :: Annex () uninitialize = gitPreCommitHookUnWrite @@ -40,7 +41,7 @@ ensureInitialized = getVersion >>= maybe needsinit checkVersion needsinit = do annexed <- Annex.Branch.hasSomeBranch if annexed - then initialize + then initialize Nothing else error "First run: git-annex init" {- set up a git pre-commit hook, if one is not already present -} |