A ref specification provides matching support and limited rules to rewrite a reference in one repository to another reference in another repository.
| Modifier and Type | Class and Description |
|---|---|
| public static enum | RefSpec.
How strict to be about wildcards. |
| Modifier and Type | Field and Description |
|---|---|
| private RefSpec. | allowMismatchedWildcards
Whether a wildcard is allowed on one side but not the other. |
| private String | dstName
Name of the ref(s) we would copy into. |
| private boolean | force
Does this specification ask for forced updated (rewind/reset)? |
| private boolean | matching
Is this the special ":" RefSpec? |
| private boolean | negative
Is this a negative refspec. |
| private static final long | |
| private String | srcName
Name of the ref(s) we would copy from. |
| private boolean | wildcard
Is this specification actually a wildcard match? |
| public static final String | WILDCARD_SUFFIX
Suffix for wildcard ref spec component, that indicate matching all refs with specified prefix. |
| Access | Constructor and Description |
|---|---|
| public | |
| public | RefSpec(String
string describing the specification. spec, RefSpec.whether to allow a wildcard on one side without a wildcard on
the other. modeParse a ref specification for use during transport operations. |
| public | |
| private |
| Modifier and Type | Method and Description |
|---|---|
| private static String | |
| public boolean | equals(Object
the reference object with which to compare. obj)Overrides java. Indicates whether some other object is "equal to" this one. |
| public RefSpec | Returns: a new specification expanded from provided ref name. Result specification is wildcard if and only if provided ref name is wildcard.a ref name that matched our destination specification. Could
be a wildcard also. r)Expand this specification to exactly match a ref name. |
| public RefSpec | Returns: a new specification expanded from provided ref name. Result specification is wildcard if and only if provided ref name is wildcard.a ref that matched our destination specification. r)Expand this specification to exactly match a ref. |
| private RefSpec | |
| public RefSpec | Returns: a new specification expanded from provided ref name. Result specification is wildcard if and only if provided ref name is wildcard.a ref name that matched our source specification. Could be a
wildcard also. r)Expand this specification to exactly match a ref name. |
| public RefSpec | Returns: a new specification expanded from provided ref name. Result specification is wildcard if and only if provided ref name is wildcard.a ref that matched our source specification. Could be a
wildcard also. r)Expand this specification to exactly match a ref. |
| private RefSpec | |
| private static String | |
| public String | Returns: name (or wildcard) pattern to match the destination ref.Get the destination ref description. |
| public String | Returns: name (or wildcard pattern) to match the source ref.Get the source ref description. |
| public int | |
| public boolean | Returns: true if this specification asks for updates without merge tests.Check if this specification wants to forcefully update the destination. |
| public boolean | Returns: whether this is a "matching" RefSpecTells whether this |
| public boolean | Returns: true if this specification is negative.Check if this specification is a negative one. |
| private static boolean | |
| private static boolean | |
| public static boolean | Returns: true if provided string is a wildcard ref spec component.ref spec component - string to test. Can be null. s)Check whether provided string is a wildcard ref spec component. |
| public boolean | Returns: true if this specification could match more than one ref.Check if this specification is actually a wildcard pattern. |
| private boolean | |
| public boolean | Returns: true if the names match; false otherwise.ref name that should be tested. r)Does this specification's destination description match the ref name? |
| public boolean | Returns: true if the names match; false otherwise.ref whose name should be tested. r)Does this specification's destination description match the ref? |
| public boolean | Returns: true if the names match; false otherwise.ref name that should be tested. r)Does this specification's source description match the ref name? |
| public boolean | Returns: true if the names match; false otherwise.ref whose name should be tested. r)Does this specification's source description match the ref? |
| public RefSpec | Returns: a new RefSpec with destination as specified.new value for destination in the returned instance. destination)Create a new RefSpec with a different destination name setting. |
| public RefSpec | Returns: a new RefSpec with force update as specified.new value for force update in the returned instance. forceUpdate)Create a new RefSpec with a different force update setting. |
| public RefSpec | |
| public RefSpec | Returns: a new RefSpec with destination as specified.new value for source in the returned instance. source, String new value for destination in the returned instance. destination)Create a new RefSpec with a different source/destination name setting. |
| public String |
| allowMismatchedWildcards | back to summary |
|---|---|
| private RefSpec. Whether a wildcard is allowed on one side but not the other. | |
| dstName | back to summary |
|---|---|
| private String dstName Name of the ref(s) we would copy into. | |
| force | back to summary |
|---|---|
| private boolean force Does this specification ask for forced updated (rewind/reset)? | |
| matching | back to summary |
|---|---|
| private boolean matching Is this the special ":" RefSpec? | |
| negative | back to summary |
|---|---|
| private boolean negative Is this a negative refspec. | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| srcName | back to summary |
|---|---|
| private String srcName Name of the ref(s) we would copy from. | |
| wildcard | back to summary |
|---|---|
| private boolean wildcard Is this specification actually a wildcard match? | |
| WILDCARD_SUFFIX | back to summary |
|---|---|
| public static final String WILDCARD_SUFFIX Suffix for wildcard ref spec component, that indicate matching all refs with specified prefix. | |
| RefSpec | back to summary |
|---|---|
| public RefSpec() Construct an empty RefSpec. A newly created empty RefSpec is not suitable for use in most applications, as at least one field must be set to match a source name. | |
| RefSpec | back to summary |
|---|---|
| public RefSpec(String spec, RefSpec. Parse a ref specification for use during transport operations.
Negative Specifications are typically one of the following forms:
| |
| RefSpec | back to summary |
|---|---|
| public RefSpec(String spec) Parse a ref specification for use during transport operations. Specifications are typically one of the following forms:
| |
| RefSpec | back to summary |
|---|---|
| private RefSpec(RefSpec p) | |
| checkValid | back to summary |
|---|---|
| private static String checkValid(String spec) | |
| equals | back to summary |
|---|---|
| public boolean equals(Object obj) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| expandFromDestination | back to summary |
|---|---|
| public RefSpec expandFromDestination(String r) Expand this specification to exactly match a ref name. Callers must first verify the passed ref name matches this specification, otherwise expansion results may be unpredictable.
| |
| expandFromDestination | back to summary |
|---|---|
| public RefSpec expandFromDestination(Ref r) Expand this specification to exactly match a ref. Callers must first verify the passed ref matches this specification, otherwise expansion results may be unpredictable.
| |
| expandFromDstImp | back to summary |
|---|---|
| private RefSpec expandFromDstImp(String name) | |
| expandFromSource | back to summary |
|---|---|
| public RefSpec expandFromSource(String r) Expand this specification to exactly match a ref name. Callers must first verify the passed ref name matches this specification, otherwise expansion results may be unpredictable.
| |
| expandFromSource | back to summary |
|---|---|
| public RefSpec expandFromSource(Ref r) Expand this specification to exactly match a ref. Callers must first verify the passed ref matches this specification, otherwise expansion results may be unpredictable.
| |
| expandFromSourceImp | back to summary |
|---|---|
| private RefSpec expandFromSourceImp(String name) | |
| expandWildcard | back to summary |
|---|---|
| private static String expandWildcard(String name, String patternA, String patternB) | |
| getDestination | back to summary |
|---|---|
| public String getDestination() Get the destination ref description. During a fetch this is the local tracking branch that will be updated with the new ObjectId after fetching is complete. During a push this is the remote ref that will be updated by the remote's receive-pack process. If null during a fetch no tracking branch should be updated and the ObjectId should be stored transiently in order to prepare a merge.
If null during a push, use
| |
| getSource | back to summary |
|---|---|
| public String getSource() Get the source ref description. During a fetch this is the name of the ref on the remote repository we are fetching from. During a push this is the name of the ref on the local repository we are pushing out from.
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| isForceUpdate | back to summary |
|---|---|
| public boolean isForceUpdate() Check if this specification wants to forcefully update the destination.
| |
| isMatching | back to summary |
|---|---|
| public boolean isMatching() Tells whether this
| |
| isNegative | back to summary |
|---|---|
| public boolean isNegative() Check if this specification is a negative one.
| |
| isNullOrEmpty | back to summary |
|---|---|
| private static boolean isNullOrEmpty(String refName) | |
| isValid | back to summary |
|---|---|
| private static boolean isValid(String s) | |
| isWildcard | back to summary |
|---|---|
| public static boolean isWildcard(String s) Check whether provided string is a wildcard ref spec component.
| |
| isWildcard | back to summary |
|---|---|
| public boolean isWildcard() Check if this specification is actually a wildcard pattern.
If this is a wildcard pattern then the source and destination names
returned by
| |
| match | back to summary |
|---|---|
| private boolean match(String name, String s) | |
| matchDestination | back to summary |
|---|---|
| public boolean matchDestination(String r) Does this specification's destination description match the ref name?
| |
| matchDestination | back to summary |
|---|---|
| public boolean matchDestination(Ref r) Does this specification's destination description match the ref?
| |
| matchSource | back to summary |
|---|---|
| public boolean matchSource(String r) Does this specification's source description match the ref name?
| |
| matchSource | back to summary |
|---|---|
| public boolean matchSource(Ref r) Does this specification's source description match the ref?
| |
| setDestination | back to summary |
|---|---|
| public RefSpec setDestination(String destination) Create a new RefSpec with a different destination name setting.
| |
| setForceUpdate | back to summary |
|---|---|
| public RefSpec setForceUpdate(boolean forceUpdate) Create a new RefSpec with a different force update setting.
| |
| setSource | back to summary |
|---|---|
| public RefSpec setSource(String source) Create a new RefSpec with a different source name setting.
| |
| setSourceDestination | back to summary |
|---|---|
| public RefSpec setSourceDestination(String source, String destination) Create a new RefSpec with a different source/destination name setting.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |
| Modifier and Type | Field and Description |
|---|---|
| public static final RefSpec. | ALLOW_MISMATCH
Allow refspecs with an asterisk on only one side. |
| public static final RefSpec. | REQUIRE_MATCH
Reject refspecs with an asterisk on the source side and not the destination side or vice versa. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static RefSpec. | |
| public static RefSpec. |
| ALLOW_MISMATCH | back to summary |
|---|---|
| public static final RefSpec. Allow refspecs with an asterisk on only one side. This can create a many-to-one mapping between source and destination refs, so expandFromSource and expandFromDestination are not usable in this mode. | |
| REQUIRE_MATCH | back to summary |
|---|---|
| public static final RefSpec. Reject refspecs with an asterisk on the source side and not the destination side or vice versa. This is the mode used by FetchCommand and PushCommand to create a one-to-one mapping between source and destination refs. | |
| WildcardMode | back to summary |
|---|---|
| private WildcardMode() | |
| valueOf | back to summary |
|---|---|
| public static RefSpec. | |
| values | back to summary |
|---|---|
| public static RefSpec. | |