Skip to content
Permalink
Browse files

[JENKINS-48061] Cleaned up comments and todos

  • Loading branch information...
rsandell committed May 4, 2018
1 parent 39f9982 commit 4a7cba88498ba5f5cdc1c4a76fac17fa0faa4f99
@@ -29,7 +29,6 @@
<no-test-jar>false</no-test-jar>
<concurrency>1C</concurrency>
<findbugs.failOnError>false</findbugs.failOnError>
<!--<workflow.version>1.14.2</workflow.version>-->
<scm-api-plugin.version>2.2.0</scm-api-plugin.version>
</properties>

@@ -369,11 +369,7 @@ protected SCMRevision retrieve(@NonNull final SCMHead head, @NonNull final TaskL
telescope.validate(remote, credentials);
return telescope.getRevision(remote, credentials, head);
}
/*if (head instanceof GitSCMHeadMixin) {
//Since it is a specific SCMHead we are after, that we know the refspec of
//we can save a bit of time and bandwidth by just fetching that refspec
context = context.withRefSpec(((GitSCMHeadMixin) head).getRef()); //TODO write test using GitRefSCMHead
}*/
//TODO write test using GitRefSCMHead
return doRetrieve(new Retriever<SCMRevision>() {
@Override
public SCMRevision run(GitClient client, String remoteName) throws IOException, InterruptedException {
@@ -440,7 +436,7 @@ protected void retrieve(@CheckForNull SCMSourceCriteria criteria,
if (context.wantTags()) {
referenceTypes.add(GitSCMTelescope.ReferenceType.TAG);
}
//TODO DiscoverOtherRefsTrait?
//TODO JENKINS-51134 DiscoverOtherRefsTrait
if (!referenceTypes.isEmpty()) {
try (GitSCMSourceRequest request = context.newRequest(AbstractGitSCMSource.this, listener)) {
listener.getLogger().println("Listing remote references...");
@@ -790,11 +786,11 @@ protected SCMRevision retrieve(@NonNull final String revision, @NonNull final Ta
// 1. A branch name (if we have that we can return quickly)
// 2. A tag name (if we have that we will need to fetch the tag to resolve the tag date)
// 3. A short/full revision hash that is the head revision of a branch (if we have that we can return quickly)
// 3.2 A remote refspec for example pull-requests/1/from
// 3.3 A short/full revision hash of a non default ref (non branch or tag but somewhere else under refs/)
// 4. A short revision hash that is the head revision of a branch (if we have that we can return quickly)
// 5. A short/full revision hash for a tag (we'll need to fetch the tag to resolve the tag date)
// 6. A short/full revision hash that is not the head revision of a branch (we'll need to fetch everything to
// 4. A remote refspec for example pull-requests/1/from
// 5. A short/full revision hash of a non default ref (non branch or tag but somewhere else under refs/)
// 6. A short revision hash that is the head revision of a branch (if we have that we can return quickly)
// 7. A short/full revision hash for a tag (we'll need to fetch the tag to resolve the tag date)
// 8. A short/full revision hash that is not the head revision of a branch (we'll need to fetch everything to
// try and resolve the hash from the history of one of the heads)
Git git = Git.with(listener, new EnvVars(EnvVars.masterEnvVars));
GitTool tool = resolveGitTool(context.gitTool());
@@ -318,6 +318,8 @@ public final C withRemoteName(String remoteName) {
public final List<RefSpec> asRefSpecs() {
List<RefSpec> result = new ArrayList<>(Math.max(refSpecs.size(), 1));
if (wantOtherRefs() && wantBranches()) {
//If wantOtherRefs() there will be a refspec in the list not added manually by a user
//So if also wantBranches() we need to add the default respec for branches so we actually fetch them
result.add(new RefSpec("+" + Constants.R_HEADS + "*:" + Constants.R_REMOTES + remoteName() + "/*"));
}
for (String template : refSpecs()) {
@@ -61,6 +61,7 @@
* @since 3.6.1
*/
public abstract class GitSCMTelescope extends SCMFileSystem.Builder {
//TODO JENKINS-51134 DiscoverOtherRefsTrait

/**
* Returns the {@link GitSCMTelescope} to use for the specified {@link GitSCM} or {@code null} if none match.

0 comments on commit 4a7cba8

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