webapp: Support for enabling known git repositories on ssh servers.

The repository must have been added using initremote.

Turned out to be much much simpler than expected, because I was able to
reuse the existing code for enabling rsync and gcrypt remotes, which
was already sufficiently general that it will also work for ssh remotes.
Total win!

This commit was sponsored by an unknown bitcoin contributor.
This commit is contained in:
Joey Hess 2014-05-22 14:10:48 -04:00
parent c07343e4f7
commit c11461b860
4 changed files with 24 additions and 8 deletions

View file

@ -189,6 +189,11 @@ repoList reposelector
Just rr | remoteLocationIsUrl (parseRemoteLocation rr g) ->
val True EnableSshGCryptR
_ -> Nothing
Just "git" ->
case getconfig "location" of
Just loc | remoteLocationIsSshUrl (parseRemoteLocation loc g) ->
val True EnableSshGitRemoteR
_ -> Nothing
_ -> Nothing
where
getconfig k = M.lookup k =<< M.lookup u m