diff options
author | Joey Hess <joey@kitenet.net> | 2011-12-13 15:05:07 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2011-12-13 15:06:49 -0400 |
commit | 13fff71f2019ae098c3f8532ac2734cb1ab11498 (patch) | |
tree | f37714c4089df4afac9bf9724c80757e5fd29e6f /Git/Types.hs | |
parent | 46588674b081cd4ea5820680d8fc15c81ed175ad (diff) |
split out three modules from Git
Constructors and configuration make sense in separate modules.
A separate Git.Types is needed to avoid cycles.
Diffstat (limited to 'Git/Types.hs')
-rw-r--r-- | Git/Types.hs | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/Git/Types.hs b/Git/Types.hs new file mode 100644 index 000000000..250da5f5e --- /dev/null +++ b/Git/Types.hs @@ -0,0 +1,36 @@ +{- git data types + - + - Copyright 2010,2011 Joey Hess <joey@kitenet.net> + - + - Licensed under the GNU GPL version 3 or higher. + -} + +module Git.Types where + +import Network.URI +import qualified Data.Map as M + +{- There are two types of repositories; those on local disk and those + - accessed via an URL. -} +data RepoLocation = Dir FilePath | Url URI | Unknown + deriving (Show, Eq) + +data Repo = Repo { + location :: RepoLocation, + config :: M.Map String String, + remotes :: [Repo], + -- remoteName holds the name used for this repo in remotes + remoteName :: Maybe String +} deriving (Show, Eq) + +{- A git ref. Can be a sha1, or a branch or tag name. -} +newtype Ref = Ref String + deriving (Eq) + +instance Show Ref where + show (Ref v) = v + +{- Aliases for Ref. -} +type Branch = Ref +type Sha = Ref +type Tag = Ref |