Add REST endpoint to get an arbitrary commit from a project

Bug: issue 2604
Change-Id: I138e60c5291d61c379e947ea26b0fd9d5555c743
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
This commit is contained in:
Edwin Kempin
2014-07-08 16:18:45 +02:00
committed by Edwin Kempin
parent 990662d0b8
commit 1b99360cc7
6 changed files with 363 additions and 1 deletions

View File

@@ -0,0 +1,36 @@
// Copyright (C) 2014 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package com.google.gerrit.server.project;
import com.google.gerrit.extensions.restapi.RestView;
import com.google.inject.TypeLiteral;
import org.eclipse.jgit.revwalk.RevCommit;
public class CommitResource extends ProjectResource {
public static final TypeLiteral<RestView<CommitResource>> COMMIT_KIND =
new TypeLiteral<RestView<CommitResource>>() {};
private final RevCommit commit;
public CommitResource(ProjectControl control, RevCommit commit) {
super(control);
this.commit = commit;
}
public RevCommit getCommit() {
return commit;
}
}