Check for and disallow pushing of invalid refs/meta/config
If the project.config or groups files are somehow invalid on the refs/meta/config branch, or would be made invalid due to a bad code review being submitted to this branch, reject the user's attempt to push. Bug: issue 1002 Change-Id: I9fafd651d875f50f501bd2a113441c2a47b3c0fa
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
// Copyright (C) 2011 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.git;
|
||||
|
||||
/** Indicates a problem with Git based data. */
|
||||
public class ValidationError {
|
||||
private final String message;
|
||||
|
||||
public ValidationError(String file, String message) {
|
||||
this(file + ": " + message);
|
||||
}
|
||||
|
||||
public ValidationError(String file, int line, String message) {
|
||||
this(file + ":" + line + ": " + message);
|
||||
}
|
||||
|
||||
public ValidationError(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ValidationError[" + message + "]";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user