Class SCMHeadOrigin.Fork
- java.lang.Object
-
- jenkins.scm.api.SCMHeadOrigin
-
- jenkins.scm.api.SCMHeadOrigin.Fork
-
- All Implemented Interfaces:
Serializable
- Enclosing class:
- SCMHeadOrigin
public static class SCMHeadOrigin.Fork extends SCMHeadOrigin
A named fork. The name should be simple not an URL. Some examples of simple names:bobsmith
which could be a user's fork where the user is Bob Smithbobsmith/foo
which could be a user's fork where the user is Bob Smith and perhaps he forked into a repository with the name "foo"manchu/bobsmith
which could be a user in Team Manchu called Bob Smith who forked the repository
Please do not use things like
https://github.com/stephenc/scm-api-plugin
as the fork name no matter how tempting.For one, this includes details that are originating from the backing source control system. If we migrated from GitHub to GitHub Enterprise, the fork would be migrated also. A good name will remain the same after such a migration... so presumably during such a migration the fork's actual location would change from
https://github.com/stephenc/scm-api-plugin
tohttps://github.example.com:8443/stephenc/scm-api-plugin
so a good name would be eitherstephenc/scm-api-plugin
orstephenc
.As GitHub encourages that forks have the same repository name the
/scm-api-plugin
is redundant, so we would choosestephenc
as the fork name when the repository name matches upstream and usestephenc/fork-of-scm-api-plugin
if the fork name differs from the upstream name.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class jenkins.scm.api.SCMHeadOrigin
SCMHeadOrigin.Default, SCMHeadOrigin.Fork
-
-
Field Summary
-
Fields inherited from class jenkins.scm.api.SCMHeadOrigin
DEFAULT
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
String
getName()
Gets the name of this fork.int
hashCode()
String
toString()
-
-
-
Constructor Detail
-
Fork
public Fork(@NonNull String name)
Creates a fork origin instance.- Parameters:
name
- the name.
-
-
Method Detail
-
getName
@Exported @NonNull public String getName()
Gets the name of this fork.- Returns:
- the name of this fork.
-
equals
public boolean equals(Object o)
- Specified by:
equals
in classSCMHeadOrigin
-
hashCode
public int hashCode()
- Specified by:
hashCode
in classSCMHeadOrigin
-
toString
public String toString()
- Specified by:
toString
in classSCMHeadOrigin
-
-