From 1681386b0ddd93efe2d6265aa1715f1f0e419e97 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 28 Feb 2014 19:16:49 -0400 Subject: [PATCH] webapp: Filter out from Switch Repository list any repositories listed in autostart file that don't have a git directory anymore. Trying to start in such a repo will, obviously, fail. Note that assistant --autostart will try to start in such a repo, and fail, but does start successfully in the other autostart repos. --- Assistant/WebApp/OtherRepos.hs | 4 +++- debian/changelog | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Assistant/WebApp/OtherRepos.hs b/Assistant/WebApp/OtherRepos.hs index e7c813a58f..e4f1ff7fce 100644 --- a/Assistant/WebApp/OtherRepos.hs +++ b/Assistant/WebApp/OtherRepos.hs @@ -25,10 +25,12 @@ listOtherRepos :: IO [(String, String)] listOtherRepos = do dirs <- readAutoStartFile pwd <- getCurrentDirectory - gooddirs <- filterM doesDirectoryExist $ + gooddirs <- filterM isrepo $ filter (\d -> not $ d `dirContains` pwd) dirs names <- mapM relHome gooddirs return $ sort $ zip names gooddirs + where + isrepo d = doesDirectoryExist (d ".git") getSwitchToRepositoryR :: FilePath -> Handler Html getSwitchToRepositoryR repo = do diff --git a/debian/changelog b/debian/changelog index e042624f30..1728306378 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,9 @@ git-annex (5.20140228) UNRELEASED; urgency=medium * Probe for quvi version at run time. + * webapp: Filter out from Switch Repository list any + repositories listed in autostart file that don't have a + git directory anymore. -- Joey Hess Fri, 28 Feb 2014 14:52:15 -0400