From 2267cdea6e550880835d5c3bc3b2a51b4f890e70 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 28 Feb 2014 19:44:15 -0400 Subject: webapp: Refuse to start in a bare git repository. --- Command/WebApp.hs | 7 +++++-- debian/changelog | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Command/WebApp.hs b/Command/WebApp.hs index d5f43432c..b252d4d7c 100644 --- a/Command/WebApp.hs +++ b/Command/WebApp.hs @@ -107,8 +107,11 @@ startNoRepo _ = do (d:_) -> do setCurrentDirectory d state <- Annex.new =<< Git.CurrentRepo.get - void $ Annex.eval state $ callCommandAction $ - start' False listenhost + void $ Annex.eval state $ do + whenM (fromRepo Git.repoIsLocalBare) $ + error $ d ++ " is a bare git repository, cannot run the webapp in it" + callCommandAction $ + start' False listenhost {- Run the webapp without a repository, which prompts the user, makes one, - changes to it, starts the regular assistant, and redirects the diff --git a/debian/changelog b/debian/changelog index 172830637..fc4b4bed3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,6 +4,7 @@ git-annex (5.20140228) UNRELEASED; urgency=medium * webapp: Filter out from Switch Repository list any repositories listed in autostart file that don't have a git directory anymore. + * webapp: Refuse to start in a bare git repository. -- Joey Hess Fri, 28 Feb 2014 14:52:15 -0400 -- cgit v1.2.3