GitRef class

Represents a parsed git reference from a package ref string

Handles parsing of git references in the format:

  • git://https://github.com/user/repo
  • git://https://github.com/user/repo:branch
  • git://https://github.com/user/repo/path/to/package:branch
  • git://git@github.com:user/repo
  • git://git@github.com:user/repo:tag
  • git://git@github.com:user/repo/path/to/package:tag

Properties

hashCode → int
The hash code for this object.
no setteroverride
path → String?
The path within the repository (optional, for monorepos)
final
ref → String?
The branch, tag, or commit reference (optional)
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
uri → String
The git URI (without the git:// prefix, without the path, and without the branch/tag/commit)
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toInternalString() → String
Creates a string representation for internal use (e.g., in SourceItem)
toString() → String
A string representation of this object.
override

Operators

operator ==(Object other) → bool
The equality operator.
override

Static Methods

fromInternalString(String internalString) → GitRef
Creates a GitRef from an internal string representation
fromPackageRef(String packageRefString) → GitRef?
Creates a GitRef from a package reference string Returns null if the string is not a valid git reference