package: only download tree & blobs for the commit we want

We can't do a real shallow clone since GitHub doesn't let you fetch
arbitrary commits. Instead we fetch the whole commit graph, but not the
file trees or file blobs, which are fetched by git checkout on-demand.
This commit is contained in:
Max Weber committed 2021-08-02 15:05:05 -06:00
1 parent 9b502e91b7
commit 00b3acafc2
2 files changed
+6 -3

No files matched your search

+2 -2
View File
@@ -29,7 +29,7 @@ jobs:
path: |
~/.gradle/caches/
~/.gradle/wrapper/
key: package-2.0.6
key: package-2.0.7
- name: prepare
run: |
pushd package
@@ -82,7 +82,7 @@ jobs:
path: |
~/.gradle/caches/
~/.gradle/wrapper/
key: upload-2.0.6
key: upload-2.0.7
- uses: actions/download-artifact@v2
with:
name: manifest_diff
@@ -266,7 +266,10 @@ public class Plugin implements Closeable
public void download() throws IOException, PluginBuildException
{
Process gitclone = new ProcessBuilder("git", "clone", "--config", "advice.detachedHead=false", this.repositoryURL, repositoryDirectory.getAbsolutePath())
Process gitclone = new ProcessBuilder("git", "clone",
"--config", "advice.detachedHead=false",
"--filter", "tree:0", "--no-checkout",
this.repositoryURL, repositoryDirectory.getAbsolutePath())
.redirectOutput(ProcessBuilder.Redirect.appendTo(logFile))
.redirectError(ProcessBuilder.Redirect.appendTo(logFile))
.start();