Merge branch 'stable-2.6' into 'stable-2.7'

* stable-2.6:
  Skip non-commits when verifying access for 'add branch' operation
  Fix gerrit-extension-api-X.Y-all-sources.jar

Change-Id: I937e595e6fef942763dd5dd4e1436212d8b6ae3b
This commit is contained in:
Edwin Kempin
2013-10-05 11:33:55 +02:00
2 changed files with 20 additions and 1 deletions

View File

@@ -51,6 +51,19 @@ limitations under the License.
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<executions>
<execution>
<id>bundle-sources</id>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>

View File

@@ -40,6 +40,7 @@ import com.google.inject.Inject;
import com.google.inject.Provider;
import com.google.inject.assistedinject.Assisted;
import org.eclipse.jgit.errors.IncorrectObjectTypeException;
import org.eclipse.jgit.lib.Ref;
import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.revwalk.RevCommit;
@@ -468,7 +469,12 @@ public class ProjectControl {
Repository repo = repoManager.openRepository(projName);
try {
for (Entry<String, Ref> entry : repo.getAllRefs().entrySet()) {
RevCommit tip = rw.parseCommit(entry.getValue().getObjectId());
RevCommit tip;
try {
tip = rw.parseCommit(entry.getValue().getObjectId());
} catch (IncorrectObjectTypeException e) {
continue;
}
if (rw.isMergedInto(commit, tip)
&& controlForRef(entry.getKey()).canPerform(Permission.READ)) {
return true;