Merge changes Ib7cb5c5e,I98f94df9

* changes:
  Move HookUtil from git.receive to git package
  config-gerrit.txt: Reword upload section header
This commit is contained in:
David Pursehouse
2017-10-14 04:27:46 +00:00
committed by Gerrit Code Review
4 changed files with 10 additions and 9 deletions

View File

@@ -4537,9 +4537,8 @@ Defaults to 0 seconds, wait indefinitely.
[[upload]]
=== Section upload
Sets the group of users allowed to execute 'upload-pack' on the
server, 'upload-pack' is what runs on the server during a user's
fetch, clone or repo sync command.
Options to control the behavior of `upload-pack` on the server side,
which handles a user's fetch, clone, or repo sync command.
----
[upload]
@@ -4549,8 +4548,8 @@ fetch, clone or repo sync command.
[[upload.allowGroup]]upload.allowGroup::
+
Name of the groups of users that are allowed to execute 'upload-pack'
on the server. One or more groups can be set.
Name of the groups of users that are allowed to execute 'upload-pack'.
One or more groups can be set.
+
If no groups are added, any user will be allowed to execute
'upload-pack' on the server.

View File

@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package com.google.gerrit.server.git.receive;
package com.google.gerrit.server.git;
import java.io.IOException;
import java.util.Map;
@@ -21,8 +21,8 @@ import org.eclipse.jgit.lib.RefDatabase;
import org.eclipse.jgit.transport.BaseReceivePack;
import org.eclipse.jgit.transport.ServiceMayNotContinueException;
/** Static utilities for writing {@link ReceiveCommits}-related hooks. */
class HookUtil {
/** Static utilities for writing git protocol hooks. */
public class HookUtil {
/**
* Scan and advertise all refs in the repo if refs have not already been advertised; otherwise,
* just return the advertised map.
@@ -31,7 +31,7 @@ class HookUtil {
* @return map of refs that were advertised.
* @throws ServiceMayNotContinueException if a problem occurred.
*/
static Map<String, Ref> ensureAllRefsAdvertised(BaseReceivePack rp)
public static Map<String, Ref> ensureAllRefsAdvertised(BaseReceivePack rp)
throws ServiceMayNotContinueException {
Map<String, Ref> refs = rp.getAdvertisedRefs();
if (refs != null) {

View File

@@ -16,6 +16,7 @@ package com.google.gerrit.server.git.receive;
import static com.google.common.base.Preconditions.checkState;
import com.google.gerrit.server.git.HookUtil;
import java.util.Map;
import org.eclipse.jgit.lib.Ref;
import org.eclipse.jgit.transport.AdvertiseRefsHook;

View File

@@ -22,6 +22,7 @@ import com.google.common.collect.Sets;
import com.google.gerrit.reviewdb.client.PatchSet;
import com.google.gerrit.reviewdb.client.Project;
import com.google.gerrit.reviewdb.client.RefNames;
import com.google.gerrit.server.git.HookUtil;
import com.google.gerrit.server.index.change.ChangeField;
import com.google.gerrit.server.query.change.ChangeData;
import com.google.gerrit.server.query.change.InternalChangeQuery;