diff options
Diffstat (limited to 'Git')
-rw-r--r-- | Git/Command.hs | 3 | ||||
-rw-r--r-- | Git/Construct.hs | 1 | ||||
-rw-r--r-- | Git/Types.hs | 3 |
3 files changed, 6 insertions, 1 deletions
diff --git a/Git/Command.hs b/Git/Command.hs index 8b027d2c3..adcc53bcd 100644 --- a/Git/Command.hs +++ b/Git/Command.hs @@ -21,7 +21,8 @@ import Git.FilePath {- Constructs a git command line operating on the specified repo. -} gitCommandLine :: [CommandParam] -> Repo -> [CommandParam] -gitCommandLine params Repo { location = l@(Local _ _ ) } = setdir : settree ++ params +gitCommandLine params r@(Repo { location = l@(Local _ _ ) }) = + setdir : settree ++ gitGlobalOpts r ++ params where setdir = Param $ "--git-dir=" ++ gitpath (gitdir l) settree = case worktree l of diff --git a/Git/Construct.hs b/Git/Construct.hs index cd998591e..71a13f49f 100644 --- a/Git/Construct.hs +++ b/Git/Construct.hs @@ -230,6 +230,7 @@ newFrom l = return Repo , remotes = [] , remoteName = Nothing , gitEnv = Nothing + , gitGlobalOpts = [] } diff --git a/Git/Types.hs b/Git/Types.hs index abfb99f9f..2a33fb27d 100644 --- a/Git/Types.hs +++ b/Git/Types.hs @@ -10,6 +10,7 @@ module Git.Types where import Network.URI import qualified Data.Map as M import System.Posix.Types +import Utility.SafeCommand {- Support repositories on local disk, and repositories accessed via an URL. - @@ -38,6 +39,8 @@ data Repo = Repo , remoteName :: Maybe String -- alternate environment to use when running git commands , gitEnv :: Maybe [(String, String)] + -- global options to pass to git when running git commands + , gitGlobalOpts :: [CommandParam] } deriving (Show, Eq) {- A git ref. Can be a sha1, or a branch or tag name. -} |