diff options
Diffstat (limited to 'Command/Init.hs')
-rw-r--r-- | Command/Init.hs | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/Command/Init.hs b/Command/Init.hs index 1074d100e..509c9e51c 100644 --- a/Command/Init.hs +++ b/Command/Init.hs @@ -41,11 +41,19 @@ perform :: String -> CommandPerform perform description = do g <- Annex.gitRepo u <- getUUID g - describeUUID u description setVersion - liftIO $ gitAttributesWrite g - gitPreCommitHookWrite g - return $ Just cleanup + if Git.repoIsLocalBare g + then do + showLongNote $ + "This is a bare repository, so its description cannot be committed.\n" ++ + "To record the description, run this command in a clone of this repository:\n" ++ + " git annex describe " ++ (show u) ++ " '" ++ description ++ "'\n\n" + return $ Just $ return True + else do + describeUUID u description + liftIO $ gitAttributesWrite g + gitPreCommitHookWrite g + return $ Just cleanup cleanup :: CommandCleanup cleanup = do |