Skip to content
Permalink
Browse files

[JENKINS-48061] Use constants not literals

  • Loading branch information...
rsandell committed Mar 20, 2018
1 parent d49fec4 commit 54c5a0306b690bdf5ae2676cdaf816d6970fcd48
@@ -29,6 +29,7 @@
import jenkins.scm.api.SCMHead;
import jenkins.scm.api.SCMHeadMigration;
import jenkins.scm.api.SCMRevision;
import org.eclipse.jgit.lib.Constants;
import org.kohsuke.accmod.Restricted;
import org.kohsuke.accmod.restrictions.NoExternalUse;

@@ -44,7 +45,7 @@ public GitBranchSCMHead(@NonNull String name) {

@Override
public String getRef() {
return "refs/heads/" + getName();
return Constants.R_HEADS + getName();
}

@Restricted(NoExternalUse.class)
@@ -17,14 +17,15 @@ public GitRefSCMHead(@NonNull String name, @NonNull String ref) {
}

/**
* Constructor.
* Constructor where ref and name is the same.
*
* @param name the name.
* @param name the name (and the ref).
*/
public GitRefSCMHead(@NonNull String name) {
this(name, name);
}

@Override
public String getRef() {
return ref;
}
@@ -28,5 +28,9 @@

public interface GitSCMHeadMixin extends SCMHeadMixin {

/**
* The ref, e.g. /refs/heads/master
* @return the ref
*/
String getRef();
}

0 comments on commit 54c5a03

Please sign in to comment.
You can’t perform that action at this time.