Skip to content

Commit 10623dd

Browse files
committed
Also recommend CloneOption.noTags
1 parent b7bd774 commit 10623dd

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<div>
22
If checked, every build performs a fresh clone of the SCM rather than locking and updating a common copy.
33
No changelog will be computed.
4-
For Git, you are advised to select <b>Advanced clone behaviors » Shallow clone</b> to make the clone much faster.
4+
For Git, you are advised to add <b>Advanced clone behaviors</b>
5+
and then check <b>Shallow clone</b> and uncheck <b>Fetch tags</b>
6+
to make the clone much faster.
57
You may still enable <b>Cache fetched versions on controller for quick retrieval</b> if you prefer.
68
</div>

src/test/java/org/jenkinsci/plugins/workflow/libs/SCMSourceRetrieverTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ public static class BasicSCMSource extends SCMSource {
379379
sampleRepo.git("add", ".");
380380
sampleRepo.git("commit", "--message=init");
381381
GitSCMSource src = new GitSCMSource(sampleRepo.toString());
382-
src.setTraits(List.<SCMSourceTrait>of(new CloneOptionTrait(new CloneOption(true, null, null))));
382+
src.setTraits(List.<SCMSourceTrait>of(new CloneOptionTrait(new CloneOption(true, true, null, null))));
383383
SCMSourceRetriever scm = new SCMSourceRetriever(src);
384384
LibraryConfiguration lc = new LibraryConfiguration("echoing", scm);
385385
lc.setIncludeInChangesets(false);
@@ -391,6 +391,7 @@ public static class BasicSCMSource extends SCMSource {
391391
assertFalse(r.jenkins.getWorkspaceFor(p).withSuffix("@libs").isDirectory());
392392
r.assertLogContains("something special", b);
393393
r.assertLogContains("Using shallow clone with depth 1", b);
394+
r.assertLogContains("Avoid fetching tags", b);
394395
// Fails to reproduce presence of *.jar.tmp@tmp; probably specific to use of GIT_ASKPASS:
395396
assertThat(new File(b.getRootDir(), "libs").list(), arrayContaining(matchesPattern("[0-9a-f]{64}[.]jar")));
396397
}

0 commit comments

Comments
 (0)