Merge branch 'stable-0.12'
* stable-0.12: Fix sorting of names in RefDirectory Make running static checks configurable in maven build Add constants for gerrit change id configuration
This commit is contained in:
commit
b9691b94a3
|
@ -107,39 +107,6 @@
|
||||||
<encoding>UTF-8</encoding>
|
<encoding>UTF-8</encoding>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
</plugins>
|
||||||
<groupId>org.codehaus.mojo</groupId>
|
|
||||||
<artifactId>findbugs-maven-plugin</artifactId>
|
|
||||||
<configuration>
|
|
||||||
<findbugsXmlOutput>true</findbugsXmlOutput>
|
|
||||||
<failOnError>false</failOnError>
|
|
||||||
</configuration>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<goals>
|
|
||||||
<goal>check</goal>
|
|
||||||
</goals>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-pmd-plugin</artifactId>
|
|
||||||
<configuration>
|
|
||||||
<sourceEncoding>utf-8</sourceEncoding>
|
|
||||||
<minimumTokens>100</minimumTokens>
|
|
||||||
<targetJdk>1.5</targetJdk>
|
|
||||||
<format>xml</format>
|
|
||||||
<failOnViolation>false</failOnViolation>
|
|
||||||
</configuration>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<goals>
|
|
||||||
<goal>cpd-check</goal>
|
|
||||||
</goals>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
|
||||||
</build>
|
</build>
|
||||||
</project>
|
</project>
|
||||||
|
|
|
@ -124,39 +124,6 @@
|
||||||
</archive>
|
</archive>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
|
||||||
<groupId>org.codehaus.mojo</groupId>
|
|
||||||
<artifactId>findbugs-maven-plugin</artifactId>
|
|
||||||
<configuration>
|
|
||||||
<findbugsXmlOutput>true</findbugsXmlOutput>
|
|
||||||
<failOnError>false</failOnError>
|
|
||||||
</configuration>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<goals>
|
|
||||||
<goal>check</goal>
|
|
||||||
</goals>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-pmd-plugin</artifactId>
|
|
||||||
<configuration>
|
|
||||||
<sourceEncoding>utf-8</sourceEncoding>
|
|
||||||
<minimumTokens>100</minimumTokens>
|
|
||||||
<targetJdk>1.5</targetJdk>
|
|
||||||
<format>xml</format>
|
|
||||||
<failOnViolation>false</failOnViolation>
|
|
||||||
</configuration>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<goals>
|
|
||||||
<goal>cpd-check</goal>
|
|
||||||
</goals>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
</project>
|
</project>
|
||||||
|
|
|
@ -455,6 +455,19 @@ public void testGetRefs_TagsOnly_AllLoose() throws IOException {
|
||||||
assertEquals(v1_0, a.getObjectId());
|
assertEquals(v1_0, a.getObjectId());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testGetRefs_LooseSortedCorrectly() throws IOException {
|
||||||
|
Map<String, Ref> refs;
|
||||||
|
|
||||||
|
writeLooseRef("refs/heads/project1/A", A);
|
||||||
|
writeLooseRef("refs/heads/project1-B", B);
|
||||||
|
|
||||||
|
refs = refdir.getRefs(RefDatabase.ALL);
|
||||||
|
assertEquals(2, refs.size());
|
||||||
|
assertEquals(A, refs.get("refs/heads/project1/A").getObjectId());
|
||||||
|
assertEquals(B, refs.get("refs/heads/project1-B").getObjectId());
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testGetRefs_TagsOnly_AllPacked() throws IOException {
|
public void testGetRefs_TagsOnly_AllPacked() throws IOException {
|
||||||
Map<String, Ref> tags;
|
Map<String, Ref> tags;
|
||||||
|
|
|
@ -98,39 +98,6 @@
|
||||||
</archive>
|
</archive>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
|
||||||
<groupId>org.codehaus.mojo</groupId>
|
|
||||||
<artifactId>findbugs-maven-plugin</artifactId>
|
|
||||||
<configuration>
|
|
||||||
<findbugsXmlOutput>true</findbugsXmlOutput>
|
|
||||||
<failOnError>false</failOnError>
|
|
||||||
</configuration>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<goals>
|
|
||||||
<goal>check</goal>
|
|
||||||
</goals>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-pmd-plugin</artifactId>
|
|
||||||
<configuration>
|
|
||||||
<sourceEncoding>utf-8</sourceEncoding>
|
|
||||||
<minimumTokens>100</minimumTokens>
|
|
||||||
<targetJdk>1.5</targetJdk>
|
|
||||||
<format>xml</format>
|
|
||||||
<failOnViolation>false</failOnViolation>
|
|
||||||
</configuration>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<goals>
|
|
||||||
<goal>cpd-check</goal>
|
|
||||||
</goals>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
</project>
|
</project>
|
||||||
|
|
|
@ -141,42 +141,17 @@
|
||||||
</archive>
|
</archive>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.codehaus.mojo</groupId>
|
|
||||||
<artifactId>findbugs-maven-plugin</artifactId>
|
|
||||||
<configuration>
|
|
||||||
<findbugsXmlOutput>true</findbugsXmlOutput>
|
|
||||||
<failOnError>false</failOnError>
|
|
||||||
<excludeFilterFile>findBugs/FindBugsExcludeFilter.xml</excludeFilterFile>
|
|
||||||
</configuration>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<goals>
|
|
||||||
<goal>check</goal>
|
|
||||||
</goals>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin>
|
|
||||||
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-pmd-plugin</artifactId>
|
|
||||||
<configuration>
|
|
||||||
<sourceEncoding>utf-8</sourceEncoding>
|
|
||||||
<minimumTokens>100</minimumTokens>
|
|
||||||
<targetJdk>1.5</targetJdk>
|
|
||||||
<format>xml</format>
|
|
||||||
<failOnViolation>false</failOnViolation>
|
|
||||||
</configuration>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<goals>
|
|
||||||
<goal>cpd-check</goal>
|
|
||||||
</goals>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
</plugins>
|
||||||
|
<pluginManagement>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.codehaus.mojo</groupId>
|
||||||
|
<artifactId>findbugs-maven-plugin</artifactId>
|
||||||
|
<configuration>
|
||||||
|
<excludeFilterFile>findBugs/FindBugsExcludeFilter.xml</excludeFilterFile>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</pluginManagement>
|
||||||
</build>
|
</build>
|
||||||
</project>
|
</project>
|
||||||
|
|
|
@ -63,6 +63,9 @@ public class ConfigConstants {
|
||||||
/** The "user" section */
|
/** The "user" section */
|
||||||
public static final String CONFIG_USER_SECTION = "user";
|
public static final String CONFIG_USER_SECTION = "user";
|
||||||
|
|
||||||
|
/** The "gerrit" section */
|
||||||
|
public static final String CONFIG_GERRIT_SECTION = "gerrit";
|
||||||
|
|
||||||
/** The "algorithm" key */
|
/** The "algorithm" key */
|
||||||
public static final String CONFIG_KEY_ALGORITHM = "algorithm";
|
public static final String CONFIG_KEY_ALGORITHM = "algorithm";
|
||||||
|
|
||||||
|
@ -127,4 +130,7 @@ public class ConfigConstants {
|
||||||
|
|
||||||
/** The "local" key (used to configure {@link #CONFIG_KEY_AUTOSETUPREBASE} */
|
/** The "local" key (used to configure {@link #CONFIG_KEY_AUTOSETUPREBASE} */
|
||||||
public static final String CONFIG_KEY_LOCAL = "local";
|
public static final String CONFIG_KEY_LOCAL = "local";
|
||||||
|
|
||||||
|
/** The "createchangeid" key */
|
||||||
|
public static final String CONFIG_KEY_CREATECHANGEID = "createchangeid";
|
||||||
}
|
}
|
||||||
|
|
|
@ -288,6 +288,7 @@ public Map<String, Ref> getRefs(String prefix) throws IOException {
|
||||||
|
|
||||||
RefList<LooseRef> loose;
|
RefList<LooseRef> loose;
|
||||||
if (scan.newLoose != null) {
|
if (scan.newLoose != null) {
|
||||||
|
scan.newLoose.sort();
|
||||||
loose = scan.newLoose.toRefList();
|
loose = scan.newLoose.toRefList();
|
||||||
if (looseRefs.compareAndSet(oldLoose, loose))
|
if (looseRefs.compareAndSet(oldLoose, loose))
|
||||||
modCnt.incrementAndGet();
|
modCnt.incrementAndGet();
|
||||||
|
@ -312,6 +313,7 @@ public Map<String, Ref> getRefs(String prefix) throws IOException {
|
||||||
loose = loose.remove(toRemove);
|
loose = loose.remove(toRemove);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
symbolic.sort();
|
||||||
|
|
||||||
return new RefMap(prefix, packed, upcast(loose), symbolic.toRefList());
|
return new RefMap(prefix, packed, upcast(loose), symbolic.toRefList());
|
||||||
}
|
}
|
||||||
|
|
40
pom.xml
40
pom.xml
|
@ -226,12 +226,37 @@
|
||||||
<groupId>org.codehaus.mojo</groupId>
|
<groupId>org.codehaus.mojo</groupId>
|
||||||
<artifactId>findbugs-maven-plugin</artifactId>
|
<artifactId>findbugs-maven-plugin</artifactId>
|
||||||
<version>2.3.2-SNAPSHOT</version>
|
<version>2.3.2-SNAPSHOT</version>
|
||||||
|
<configuration>
|
||||||
|
<findbugsXmlOutput>true</findbugsXmlOutput>
|
||||||
|
<failOnError>false</failOnError>
|
||||||
|
</configuration>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<goals>
|
||||||
|
<goal>check</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-pmd-plugin</artifactId>
|
<artifactId>maven-pmd-plugin</artifactId>
|
||||||
<version>2.5</version>
|
<version>2.5</version>
|
||||||
|
<configuration>
|
||||||
|
<sourceEncoding>utf-8</sourceEncoding>
|
||||||
|
<minimumTokens>100</minimumTokens>
|
||||||
|
<targetJdk>1.5</targetJdk>
|
||||||
|
<format>xml</format>
|
||||||
|
<failOnViolation>false</failOnViolation>
|
||||||
|
</configuration>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<goals>
|
||||||
|
<goal>cpd-check</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</pluginManagement>
|
</pluginManagement>
|
||||||
|
@ -361,6 +386,21 @@
|
||||||
<module>org.eclipse.jgit.console</module>
|
<module>org.eclipse.jgit.console</module>
|
||||||
</modules>
|
</modules>
|
||||||
</profile>
|
</profile>
|
||||||
|
<profile>
|
||||||
|
<id>static-checks</id>
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.codehaus.mojo</groupId>
|
||||||
|
<artifactId>findbugs-maven-plugin</artifactId>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-pmd-plugin</artifactId>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
</profile>
|
||||||
</profiles>
|
</profiles>
|
||||||
|
|
||||||
<modules>
|
<modules>
|
||||||
|
|
Loading…
Reference in New Issue