Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified launchable/jar/exe_deploy.jar
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ public class CommitGraphCollector {

private int maxDays;

private boolean reportAllFiles;

private boolean audit;

private boolean dryRun;
Expand Down Expand Up @@ -150,7 +152,7 @@ public void transfer(URL service, Authenticator authenticator, boolean enableTim
}
CloseableHttpResponse latestResponse = client.execute(new HttpGet(latestUrl.toExternalForm()));
ImmutableList<ObjectId> advertised = getAdvertisedRefs(handleError(latestUrl, latestResponse));
honorMaxDaysHeader(latestResponse);
honorControlHeaders(latestResponse);

// every time a new stream is needed, supply ByteArrayOutputStream, and when the data is all
// written, turn around and ship that over
Expand Down Expand Up @@ -301,16 +303,21 @@ public void accept(VirtualFile f) {
}
}

/**
* When a user incorrectly configures shallow clone, the incremental nature of commit collection
* makes it really hard for us and users to collaboratively reset and repopulate the commit data.
* This server-side override mechanism makes it easier.
*/
private void honorMaxDaysHeader(HttpResponse response) {
private void honorControlHeaders(HttpResponse response) {
// When a user incorrectly configures shallow clone, the incremental nature of commit collection
// makes it really hard for us and users to collaboratively reset and repopulate the commit data.
// This server-side override mechanism makes it easier.
Header h = response.getFirstHeader("X-Max-Days");
if (h!=null) {
maxDays = Integer.parseInt(h.getValue());
}
// File transfer is supposed to work incrementally, but we are investigating the problem where
// not all files get collected prior to commit collection, resulting in incomplete data on the server side.
// As a temporary mitigation, allow the server to request all files to be reported.
h = response.getFirstHeader("X-Report-All-Files");
if (h!=null) {
reportAllFiles = true;
}
}

private ImmutableList<ObjectId> getAdvertisedRefs(HttpResponse response) throws IOException {
Expand Down Expand Up @@ -436,7 +443,9 @@ public void transfer(Collection<ObjectId> advertised, Consumer<JSCommit> commitR
try {
RevCommit c = walk.parseCommit(id);
walk.markUninteresting(c);
treeWalk.addTree(c.getTree());
if (!reportAllFiles) {
treeWalk.addTree(c.getTree());
}
} catch (MissingObjectException e) {
// it's possible that the server advertises a commit we don't have.
//
Expand Down
Loading