Summary
Represents a Git reference name in both its canonical (
refs/heads/main) and friendly (main) forms.
- Namespace
-
GitVersion
.Git - Interfaces
-
-
IComparable
<ReferenceName>
-
IComparable
- Base Types
-
-
IEquatable
<ReferenceName>
-
IEquatable
graph BT Type-->Base0["IEquatable<ReferenceName>"]
Type-.->Interface0["IComparable<ReferenceName>"]
Type["ReferenceName"] class Type type-node
Syntax
public sealed class ReferenceName : IEquatable<ReferenceName>, IComparable<ReferenceName>
Constructors
| Name | Summary |
|---|---|
|
ReferenceName |
Initializes a new
ReferenceName
from its canonical form.
|
Fields
| Name | Constant Value | Summary |
|---|---|---|
| LocalBranchPrefix | refs/heads/ |
The canonical prefix for local branches.
static
|
|
Remote |
refs/remotes/ |
The canonical prefix for remote-tracking branches.
static
|
Properties
| Name | Value | Summary |
|---|---|---|
| Canonical | string |
Gets the canonical reference name (e.g.
refs/heads/main).
|
| Friendly | string |
Gets the shortened, human-readable reference name (e.g.
main or
origin/main).
|
| IsLocalBranch | bool |
Gets a value indicating whether this is a local branch
reference.
|
| IsPullRequest | bool |
Gets a value indicating whether this reference
corresponds to a pull request.
|
| IsRemoteBranch | bool |
Gets a value indicating whether this is a
remote-tracking branch reference.
|
| IsTag | bool |
Gets a value indicating whether this is a tag reference.
|
| WithoutOrigin | string |
Gets the friendly name with the
origin/ prefix removed for
remote-tracking branches.
|
Methods
| Name | Value | Summary |
|---|---|---|
|
CompareTo |
int |
Compares this instance to
other by
canonical name.
|
|
Equals |
bool | |
|
Equals |
bool |
Returns
true when the canonical
name of this instance equals that of
other.
|
|
EquivalentTo |
bool |
Returns
true when
name matches
any of the canonical, friendly, or origin-stripped forms
of this reference.
|
|
FromBranchName |
ReferenceName |
Creates a
ReferenceName
from a branch name, automatically prepending the
local-branch prefix when necessary.
static
|
|
GetHashCode |
int |
Returns a hash code based on the canonical name.
|
|
Parse |
ReferenceName |
Parses
canonicalName
as a canonical Git reference name, throwing when the
input is not a valid canonical form.
static
|
|
ToString |
string |
Returns the friendly (shortened) name of this reference.
|
Operators
| Name | Value | Summary |
|---|---|---|
|
operator != |
bool | |
|
operator |
bool | |
|
operator |
bool | |
|
operator == |
bool | |
|
operator > |
bool | |
|
operator > |
bool |
Extension Methods
| Name | Value | Summary |
|---|---|---|
|
NotNull |
T |
Throws
ArgumentNullException when
value is
null; otherwise returns the
value.
From
CommonExtensions
|