From f67d5abc4151ade734cd8d22b5a6b59d83c33cf8 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 8 Apr 2014 16:16:46 -0400 Subject: [PATCH] support gcrypt remotes (assuming them to be over ssh transport) --- Git/GCrypt.hs | 5 ++++- RemoteDaemon/Transport.hs | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Git/GCrypt.hs b/Git/GCrypt.hs index 156441daeb..fb99cf6199 100644 --- a/Git/GCrypt.hs +++ b/Git/GCrypt.hs @@ -16,8 +16,11 @@ import qualified Git.Config as Config import qualified Git.Command as Command import Utility.Gpg +urlScheme :: String +urlScheme = "gcrypt:" + urlPrefix :: String -urlPrefix = "gcrypt::" +urlPrefix = urlScheme ++ ":" isEncrypted :: Repo -> Bool isEncrypted Repo { location = Url url } = urlPrefix `isPrefixOf` show url diff --git a/RemoteDaemon/Transport.hs b/RemoteDaemon/Transport.hs index 1bac7f8778..09118ca8b8 100644 --- a/RemoteDaemon/Transport.hs +++ b/RemoteDaemon/Transport.hs @@ -9,6 +9,7 @@ module RemoteDaemon.Transport where import RemoteDaemon.Types import qualified RemoteDaemon.Transport.Ssh +import qualified Git.GCrypt import qualified Data.Map as M @@ -18,4 +19,5 @@ type TransportScheme = String remoteTransports :: M.Map TransportScheme Transport remoteTransports = M.fromList [ ("ssh:", RemoteDaemon.Transport.Ssh.transport) + , (Git.GCrypt.urlScheme, RemoteDaemon.Transport.Ssh.transport) ]