summaryrefslogtreecommitdiff
path: root/Git/Types.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Git/Types.hs')
-rw-r--r--Git/Types.hs36
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