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.
This commit is contained in:
Joey Hess 2014-02-28 19:16:49 -04:00
parent fb2a38963f
commit 1681386b0d
2 changed files with 6 additions and 1 deletions

View file

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

3
debian/changelog vendored
View file

@ -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 <joeyh@debian.org> Fri, 28 Feb 2014 14:52:15 -0400