Merge branch 'stable-6.5'
* stable-6.5: Ensure parsed RevCommitCG has derived data from commit-graph Downgrade maven-site-plugin to 3.12.1 Use wagon-ssh-external to deploy Maven site Change-Id: Ide721fb088fa04f6276ac495968a45e732f6e139
This commit is contained in:
commit
75db060673
|
@ -175,12 +175,12 @@
|
|||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-site-plugin</artifactId>
|
||||
<version>4.0.0-M4</version>
|
||||
<version>3.12.1</version>
|
||||
<dependencies>
|
||||
<dependency><!-- add support for ssh/scp -->
|
||||
<groupId>org.apache.maven.wagon</groupId>
|
||||
<artifactId>wagon-ssh</artifactId>
|
||||
<version>3.5.2</version>
|
||||
<artifactId>wagon-ssh-external</artifactId>
|
||||
<version>3.5.3</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</plugin>
|
||||
|
|
|
@ -313,7 +313,7 @@
|
|||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-site-plugin</artifactId>
|
||||
<version>3.9.1</version>
|
||||
<version>3.12.1</version>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
|
|
|
@ -83,6 +83,42 @@ public void testParseHeaders() throws Exception {
|
|||
assertArrayEquals(notParseInGraph.getParents(), noBody.getParents());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testParseCanonical() throws Exception {
|
||||
RevCommit c1 = commitFile("file1", "1", "master");
|
||||
enableAndWriteCommitGraph();
|
||||
|
||||
RevCommit notParseInGraph = rw.lookupCommit(c1);
|
||||
rw.parseHeaders(notParseInGraph);
|
||||
|
||||
reinitializeRevWalk();
|
||||
RevCommit parseInGraph = rw.lookupCommit(c1);
|
||||
parseInGraph.parseCanonical(rw, rw.getCachedBytes(c1));
|
||||
|
||||
assertTrue(parseInGraph instanceof RevCommitCG);
|
||||
assertNotNull(parseInGraph.getRawBuffer());
|
||||
assertEquals(1, parseInGraph.getGeneration());
|
||||
assertEquals(notParseInGraph.getId(), parseInGraph.getId());
|
||||
assertEquals(notParseInGraph.getTree(), parseInGraph.getTree());
|
||||
assertEquals(notParseInGraph.getCommitTime(),
|
||||
parseInGraph.getCommitTime());
|
||||
assertArrayEquals(notParseInGraph.getParents(),
|
||||
parseInGraph.getParents());
|
||||
|
||||
reinitializeRevWalk();
|
||||
rw.setRetainBody(false);
|
||||
RevCommit noBody = rw.lookupCommit(c1);
|
||||
noBody.parseCanonical(rw, rw.getCachedBytes(c1));
|
||||
|
||||
assertTrue(noBody instanceof RevCommitCG);
|
||||
assertNull(noBody.getRawBuffer());
|
||||
assertEquals(1, noBody.getGeneration());
|
||||
assertEquals(notParseInGraph.getId(), noBody.getId());
|
||||
assertEquals(notParseInGraph.getTree(), noBody.getTree());
|
||||
assertEquals(notParseInGraph.getCommitTime(), noBody.getCommitTime());
|
||||
assertArrayEquals(notParseInGraph.getParents(), noBody.getParents());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testInitializeShallowCommits() throws Exception {
|
||||
RevCommit c1 = commit(commit());
|
||||
|
|
|
@ -125,7 +125,15 @@ public static RevCommit parse(RevWalk rw, byte[] raw) throws IOException {
|
|||
|
||||
int inDegree;
|
||||
|
||||
private byte[] buffer;
|
||||
/**
|
||||
* Raw unparsed commit body of the commit. Populated only
|
||||
* after {@link #parseCanonical(RevWalk, byte[])} with
|
||||
* {@link RevWalk#isRetainBody()} enable or after
|
||||
* {@link #parseBody(RevWalk)} and {@link #parse(RevWalk, byte[])}.
|
||||
*
|
||||
* @since 6.5.1
|
||||
*/
|
||||
protected byte[] buffer;
|
||||
|
||||
/**
|
||||
* Create a new commit reference.
|
||||
|
|
|
@ -44,10 +44,27 @@ protected RevCommitCG(AnyObjectId id, int graphPosition) {
|
|||
this.graphPosition = graphPosition;
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
void parseCanonical(RevWalk walk, byte[] raw) throws IOException {
|
||||
if (walk.isRetainBody()) {
|
||||
buffer = raw;
|
||||
}
|
||||
parseInGraph(walk);
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
void parseHeaders(RevWalk walk) throws MissingObjectException,
|
||||
IncorrectObjectTypeException, IOException {
|
||||
if (walk.isRetainBody()) {
|
||||
super.parseBody(walk); // This parses header and body
|
||||
return;
|
||||
}
|
||||
parseInGraph(walk);
|
||||
}
|
||||
|
||||
private void parseInGraph(RevWalk walk) throws IOException {
|
||||
CommitGraph graph = walk.commitGraph();
|
||||
CommitGraph.CommitData data = graph.getCommitData(graphPosition);
|
||||
if (data == null) {
|
||||
|
@ -78,11 +95,7 @@ void parseHeaders(RevWalk walk) throws MissingObjectException,
|
|||
this.parents = pList;
|
||||
}
|
||||
}
|
||||
|
||||
flags |= PARSED;
|
||||
if (walk.isRetainBody()) {
|
||||
super.parseBody(walk);
|
||||
}
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
|
|
6
pom.xml
6
pom.xml
|
@ -344,12 +344,12 @@
|
|||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-site-plugin</artifactId>
|
||||
<version>4.0.0-M4</version>
|
||||
<version>3.12.1</version>
|
||||
<dependencies>
|
||||
<dependency><!-- add support for ssh/scp -->
|
||||
<groupId>org.apache.maven.wagon</groupId>
|
||||
<artifactId>wagon-ssh</artifactId>
|
||||
<version>3.5.2</version>
|
||||
<artifactId>wagon-ssh-external</artifactId>
|
||||
<version>3.5.3</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</plugin>
|
||||
|
|
Loading…
Reference in New Issue