Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Git constrains the names of references (branches, tags, etc.) to a collection of 10-or-so rules (see
git help check-ref-format
for details). This module provides checked wrappers for refnames and
remote names.
Synopsis
- data RefName
- getRefName :: RefName -> RawFilePath
- refName :: RawFilePath -> Maybe RefName
- checkRefFormat :: Bool -> Bool -> RawFilePath -> Bool
- data RemoteName
- getRemoteName :: RemoteName -> ByteString
- remoteName :: RawFilePath -> Maybe RemoteName
- checkRemoteName :: ByteString -> Bool
Reference Names
Safe reference names. Construct with refName
.
getRefName :: RefName -> RawFilePath Source #
The RefName
s underlying RawFilePath
refName :: RawFilePath -> Maybe RefName Source #
Try to make a RefName
, given that checkRefFormat
allows it.
:: Bool | Allow refnames with no |
-> Bool | Allow one and only one asterisk in a ref, as |
-> RawFilePath | |
-> Bool |
Check a potential refname against the rules for well formed refnames according to git help
check-ref-format
Remote Names
data RemoteName Source #
Safe remote names. Construct with remoteName
.
Instances
Eq RemoteName Source # | |
Defined in Data.Git.RefName (==) :: RemoteName -> RemoteName -> Bool # (/=) :: RemoteName -> RemoteName -> Bool # | |
Ord RemoteName Source # | |
Defined in Data.Git.RefName compare :: RemoteName -> RemoteName -> Ordering # (<) :: RemoteName -> RemoteName -> Bool # (<=) :: RemoteName -> RemoteName -> Bool # (>) :: RemoteName -> RemoteName -> Bool # (>=) :: RemoteName -> RemoteName -> Bool # max :: RemoteName -> RemoteName -> RemoteName # min :: RemoteName -> RemoteName -> RemoteName # | |
Show RemoteName Source # | |
Defined in Data.Git.RefName showsPrec :: Int -> RemoteName -> ShowS # show :: RemoteName -> String # showList :: [RemoteName] -> ShowS # | |
IsString RemoteName Source # | |
Defined in Data.Git.RefName fromString :: String -> RemoteName # |
getRemoteName :: RemoteName -> ByteString Source #
The RemoteName
s underlying RawFilePath
remoteName :: RawFilePath -> Maybe RemoteName Source #
Try to make a RemoteName
, ensuring it's valid according to checkRemoteName
.
checkRemoteName :: ByteString -> Bool Source #
Ensure the name is contains no /
, and is none of: ""
, "."
, per
https://github.com/git/git/blob/1f66975deb8402131fbf7c14330d0c7cdebaeaa2/remote.c#L644.