From 049c35574d154a6d5a21b9e33de263ce9af12a2d Mon Sep 17 00:00:00 2001 From: Edwin Kempin Date: Tue, 15 Apr 2014 11:26:23 +0200 Subject: [PATCH 1/7] Allow plugins to refresh Gerrit's menu bar Change-Id: Id908ebe23a07f2ae45e131a9b8a98c24f4a9cf74 Signed-off-by: Edwin Kempin --- Documentation/js-api.txt | 4 ++++ .../java/com/google/gerrit/client/api/ActionContext.java | 1 + .../src/main/java/com/google/gerrit/client/api/ApiGlue.java | 5 +++++ .../src/main/java/com/google/gerrit/client/api/Plugin.java | 1 + .../main/java/com/google/gerrit/plugin/client/Plugin.java | 4 ++++ 5 files changed, 15 insertions(+) diff --git a/Documentation/js-api.txt b/Documentation/js-api.txt index d41eab5809..396edf61f9 100644 --- a/Documentation/js-api.txt +++ b/Documentation/js-api.txt @@ -872,6 +872,10 @@ Gerrit.screen(pattern, callback); === Gerrit.refresh() Redisplays the current web UI view, refreshing all information. +[[Gerrit_refreshMenuBar]] +=== Gerrit.refreshMenuBar() +Refreshes Gerrit's menu bar. + [[Gerrit_url]] === Gerrit.url() Returns the URL of the Gerrit Code Review server. If invoked with diff --git a/gerrit-gwtui/src/main/java/com/google/gerrit/client/api/ActionContext.java b/gerrit-gwtui/src/main/java/com/google/gerrit/client/api/ActionContext.java index fb6cfc48b1..453a3f2417 100644 --- a/gerrit-gwtui/src/main/java/com/google/gerrit/client/api/ActionContext.java +++ b/gerrit-gwtui/src/main/java/com/google/gerrit/client/api/ActionContext.java @@ -37,6 +37,7 @@ public class ActionContext extends JavaScriptObject { Gerrit.ActionContext.prototype = { go: Gerrit.go, refresh: Gerrit.refresh, + refreshMenuBar: Gerrit.refreshMenuBar, showError: Gerrit.showError, br: function(){return doc.createElement('br')}, diff --git a/gerrit-gwtui/src/main/java/com/google/gerrit/client/api/ApiGlue.java b/gerrit-gwtui/src/main/java/com/google/gerrit/client/api/ApiGlue.java index 4fa467ab51..976dc0c213 100644 --- a/gerrit-gwtui/src/main/java/com/google/gerrit/client/api/ApiGlue.java +++ b/gerrit-gwtui/src/main/java/com/google/gerrit/client/api/ApiGlue.java @@ -62,6 +62,7 @@ public class ApiGlue { go: @com.google.gerrit.client.api.ApiGlue::go(Ljava/lang/String;), refresh: @com.google.gerrit.client.api.ApiGlue::refresh(), + refreshMenuBar: @com.google.gerrit.client.api.ApiGlue::refreshMenuBar(), showError: @com.google.gerrit.client.api.ApiGlue::showError(Ljava/lang/String;), on: function (e,f){(this.events[e] || (this.events[e]=[])).push(f)}, @@ -189,6 +190,10 @@ public class ApiGlue { Gerrit.display(History.getToken()); } + private static final void refreshMenuBar() { + Gerrit.refreshMenuBar(); + } + private static final void showError(String message) { new ErrorDialog(message).center(); } diff --git a/gerrit-gwtui/src/main/java/com/google/gerrit/client/api/Plugin.java b/gerrit-gwtui/src/main/java/com/google/gerrit/client/api/Plugin.java index 00c674f9c8..7ef022a62b 100644 --- a/gerrit-gwtui/src/main/java/com/google/gerrit/client/api/Plugin.java +++ b/gerrit-gwtui/src/main/java/com/google/gerrit/client/api/Plugin.java @@ -52,6 +52,7 @@ final class Plugin extends JavaScriptObject { getPluginName: function(){return this.name}, go: @com.google.gerrit.client.api.ApiGlue::go(Ljava/lang/String;), refresh: @com.google.gerrit.client.api.ApiGlue::refresh(), + refreshMenuBar: @com.google.gerrit.client.api.ApiGlue::refreshMenuBar(), showError: @com.google.gerrit.client.api.ApiGlue::showError(Ljava/lang/String;), on: function(e,f){G.on(e,f)}, onAction: function(t,n,c){G._onAction(this.name,t,n,c)}, diff --git a/gerrit-plugin-gwtui/src/main/java/com/google/gerrit/plugin/client/Plugin.java b/gerrit-plugin-gwtui/src/main/java/com/google/gerrit/plugin/client/Plugin.java index 41c03a25de..046488d969 100644 --- a/gerrit-plugin-gwtui/src/main/java/com/google/gerrit/plugin/client/Plugin.java +++ b/gerrit-plugin-gwtui/src/main/java/com/google/gerrit/plugin/client/Plugin.java @@ -50,6 +50,10 @@ public final class Plugin extends JavaScriptObject { public final native void refresh() /*-{ return this.refresh() }-*/; + /** Refresh Gerrit's menu bar. */ + public final native void refreshMenuBar() + /*-{ return this.refreshMenuBar() }-*/; + /** Show message in Gerrit's ErrorDialog. */ public final native void showError(String message) /*-{ return this.showError(message) }-*/; From 62096c7b030ed24f1561ef8163e28216cda764f9 Mon Sep 17 00:00:00 2001 From: David Ostrovsky Date: Wed, 12 Feb 2014 08:01:03 +0100 Subject: [PATCH 2/7] Prevent draft changes from being abandoned When a draft change is abandoned it is currently published to all users by setting the status to ABANDONED. Restoring the change will effectively publish the change as /restore sets the status to NEW. To not complicate the workflow, prevent draft changes from being abandoned. Change-Id: If747264fa66a2139e0d8f13987125d853ec3bed9 --- .../src/main/java/com/google/gerrit/server/change/Abandon.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/change/Abandon.java b/gerrit-server/src/main/java/com/google/gerrit/server/change/Abandon.java index 4959cfb0e3..b406af01a1 100644 --- a/gerrit-server/src/main/java/com/google/gerrit/server/change/Abandon.java +++ b/gerrit-server/src/main/java/com/google/gerrit/server/change/Abandon.java @@ -85,6 +85,8 @@ public class Abandon implements RestModifyView, throw new AuthException("abandon not permitted"); } else if (!change.getStatus().isOpen()) { throw new ResourceConflictException("change is " + status(change)); + } else if (change.getStatus() == Change.Status.DRAFT) { + throw new ResourceConflictException("draft changes cannot be abandoned"); } ChangeMessage message; @@ -141,6 +143,7 @@ public class Abandon implements RestModifyView, .setLabel("Abandon") .setTitle("Abandon the change") .setVisible(resource.getChange().getStatus().isOpen() + && resource.getChange().getStatus() != Change.Status.DRAFT && resource.getControl().canAbandon()); } From 6534b9eb477b35a8d2799a12e7e0c80e0c918f16 Mon Sep 17 00:00:00 2001 From: David Pursehouse Date: Tue, 15 Apr 2014 18:56:54 +0900 Subject: [PATCH 3/7] Don't show the submit button for draft patch sets Currently the button is enabled for all open changes, but if the patch set is a draft, pressing it results in an error. Change-Id: I382fc9330b73d357c00ba0209f18d2c1584e9256 --- .../src/main/java/com/google/gerrit/server/change/Submit.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/change/Submit.java b/gerrit-server/src/main/java/com/google/gerrit/server/change/Submit.java index 33890317ad..cb411250d3 100644 --- a/gerrit-server/src/main/java/com/google/gerrit/server/change/Submit.java +++ b/gerrit-server/src/main/java/com/google/gerrit/server/change/Submit.java @@ -150,7 +150,8 @@ public class Submit implements RestModifyView, .setTitle(String.format( "Submit revision %d", resource.getPatchSet().getPatchSetId())) - .setVisible(resource.getChange().getStatus().isOpen() + .setVisible(!resource.getPatchSet().isDraft() + && resource.getChange().getStatus().isOpen() && resource.getPatchSet().getId().equals(current) && resource.getControl().canSubmit()); } From e3ba9e44e69fdedf6bcea1725d6682fa9e599296 Mon Sep 17 00:00:00 2001 From: Anthony Chin Date: Thu, 10 Apr 2014 13:38:22 -0400 Subject: [PATCH 4/7] Do not refresh group list if filter did not change Every time key up event is raised in the group list filter box, the group list was getting refreshed even if the filter did not change (e.g. moving the cursor was refreshing the list). Only call the refresh if the filter is changed or enter is pressed. Change-Id: I64d24eeae08f35723b401fffd9a3e8ed84c8d00c --- .../google/gerrit/client/admin/GroupListScreen.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/gerrit-gwtui/src/main/java/com/google/gerrit/client/admin/GroupListScreen.java b/gerrit-gwtui/src/main/java/com/google/gerrit/client/admin/GroupListScreen.java index bed6b4a2d0..cf9fb041f7 100644 --- a/gerrit-gwtui/src/main/java/com/google/gerrit/client/admin/GroupListScreen.java +++ b/gerrit-gwtui/src/main/java/com/google/gerrit/client/admin/GroupListScreen.java @@ -34,7 +34,7 @@ import com.google.gwtexpui.globalkey.client.NpTextBox; public class GroupListScreen extends AccountScreen implements FilteredUserInterface { private GroupTable groups; private NpTextBox filterTxt; - private String subname; + private String subname = ""; public GroupListScreen() { } @@ -104,8 +104,12 @@ public class GroupListScreen extends AccountScreen implements FilteredUserInterf filterTxt.addKeyUpHandler(new KeyUpHandler() { @Override public void onKeyUp(KeyUpEvent event) { - subname = filterTxt.getValue(); - refresh(event.getNativeEvent().getKeyCode() == KeyCodes.KEY_ENTER); + boolean enterPressed = + event.getNativeEvent().getKeyCode() == KeyCodes.KEY_ENTER; + if (enterPressed || !filterTxt.getValue().equals(subname)) { + subname = filterTxt.getValue(); + refresh(enterPressed); + } } }); hp.add(filterTxt); From dc78329e347abed59247dd7e3846d5996bc5a1ee Mon Sep 17 00:00:00 2001 From: Anthony Chin Date: Thu, 10 Apr 2014 11:14:41 -0400 Subject: [PATCH 5/7] Add option 'n' and 'S' to groups REST API to limit group results. List groups endpoint now has an option to limit the number of results returned and a start to define nonzero offset in order to support groups pagination. Add and document 'n' and 'S' function to allow query group list from a specified limit and start. Both options will then be used to render group list with pagination in web UI. Change-Id: Ibf244b1cfe83c56dc1c23aabf70a55697b52c835 --- Documentation/rest-api-groups.txt | 18 +++++++++++++++ .../gerrit/server/group/ListGroups.java | 22 +++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/Documentation/rest-api-groups.txt b/Documentation/rest-api-groups.txt index 6289e5a419..2f73fc7deb 100644 --- a/Documentation/rest-api-groups.txt +++ b/Documentation/rest-api-groups.txt @@ -165,6 +165,24 @@ returned. } ---- +[[group-limit]] +==== Group Limit +The `/groups/` URL also accepts a limit integer in the `n` parameter. +This limits the results to show `n` groups. + +Query the first 25 groups in group list. +---- + GET /groups/?n=25 HTTP/1.0 +---- + +The `/groups/` URL also accepts a start integer in the `S` parameter. +The results will skip `S` groups from group list. + +Query 25 groups starting from index 50. +---- + GET /groups/?n=25&S=50 HTTP/1.0 +---- + [[get-group]] Get Group ~~~~~~~~~ diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/group/ListGroups.java b/gerrit-server/src/main/java/com/google/gerrit/server/group/ListGroups.java index 03ec06722a..4764e41831 100644 --- a/gerrit-server/src/main/java/com/google/gerrit/server/group/ListGroups.java +++ b/gerrit-server/src/main/java/com/google/gerrit/server/group/ListGroups.java @@ -93,6 +93,12 @@ public class ListGroups implements RestReadView { groupsToInspect.add(id); } + @Option(name = "--limit", aliases = {"-n"}, metaVar = "CNT", usage = "maximum number of groups to list") + private int limit; + + @Option(name = "-S", metaVar = "CNT", usage = "number of groups to skip") + private int start; + @Option(name = "-m", metaVar = "MATCH", usage = "match group substring") private String matchSubstring; @@ -175,7 +181,15 @@ public class ListGroups implements RestReadView { groupList = filterGroups(groupCache.all()); } groupInfos = Lists.newArrayListWithCapacity(groupList.size()); + int found = 0; + int foundIndex = 0; for (AccountGroup group : groupList) { + if (foundIndex++ < start) { + continue; + } + if (limit > 0 && ++found > limit) { + break; + } groupInfos.add(json.addOptions(options).format( GroupDescriptions.forAccountGroup(group))); } @@ -187,11 +201,19 @@ public class ListGroups implements RestReadView { private List getGroupsOwnedBy(IdentifiedUser user) throws OrmException { List groups = Lists.newArrayList(); + int found = 0; + int foundIndex = 0; for (AccountGroup g : filterGroups(groupCache.all())) { GroupControl ctl = groupControlFactory.controlFor(g); try { if (genericGroupControlFactory.controlFor(user, g.getGroupUUID()) .isOwner()) { + if (foundIndex++ < start) { + continue; + } + if (limit > 0 && ++found > limit) { + break; + } groups.add(json.addOptions(options).format(ctl.getGroup())); } } catch (NoSuchGroupException e) { From d5edded54ddc2db50dd06130b79c839782873a65 Mon Sep 17 00:00:00 2001 From: Anthony Chin Date: Fri, 11 Apr 2014 12:38:31 -0400 Subject: [PATCH 6/7] Implement pagination in group list screen Group list screen now uses pagination similar to project list screen. The number of groups displayed is determined by the 'Maximum Page Size' in user preferences. Change-Id: Id4649fda4b06ef62bf9d630460aeefc1c5f65989 --- .../gerrit/client/admin/AdminConstants.java | 3 + .../client/admin/AdminConstants.properties | 3 + .../gerrit/client/admin/GroupListScreen.java | 88 +++++++++++++++++-- .../gerrit/client/admin/GroupTable.java | 10 ++- .../google/gerrit/client/groups/GroupMap.java | 16 ++-- 5 files changed, 106 insertions(+), 14 deletions(-) diff --git a/gerrit-gwtui/src/main/java/com/google/gerrit/client/admin/AdminConstants.java b/gerrit-gwtui/src/main/java/com/google/gerrit/client/admin/AdminConstants.java index 530c0a77bc..cb96e38631 100644 --- a/gerrit-gwtui/src/main/java/com/google/gerrit/client/admin/AdminConstants.java +++ b/gerrit-gwtui/src/main/java/com/google/gerrit/client/admin/AdminConstants.java @@ -133,4 +133,7 @@ public interface AdminConstants extends Constants { String pagedProjectListPrev(); String pagedProjectListNext(); + + String pagedGroupListPrev(); + String pagedGroupListNext(); } diff --git a/gerrit-gwtui/src/main/java/com/google/gerrit/client/admin/AdminConstants.properties b/gerrit-gwtui/src/main/java/com/google/gerrit/client/admin/AdminConstants.properties index c54adb51fd..6a25a09ad7 100644 --- a/gerrit-gwtui/src/main/java/com/google/gerrit/client/admin/AdminConstants.properties +++ b/gerrit-gwtui/src/main/java/com/google/gerrit/client/admin/AdminConstants.properties @@ -98,6 +98,9 @@ errorNoGitRepository = No Git Repository pagedProjectListPrev = ⇦Prev pagedProjectListNext = Next⇨ +pagedGroupListPrev = ⇦Prev +pagedGroupListNext = Next⇨ + addPermission = Add Permission ... # Permission Names diff --git a/gerrit-gwtui/src/main/java/com/google/gerrit/client/admin/GroupListScreen.java b/gerrit-gwtui/src/main/java/com/google/gerrit/client/admin/GroupListScreen.java index cf9fb041f7..6579f83e96 100644 --- a/gerrit-gwtui/src/main/java/com/google/gerrit/client/admin/GroupListScreen.java +++ b/gerrit-gwtui/src/main/java/com/google/gerrit/client/admin/GroupListScreen.java @@ -21,8 +21,10 @@ import com.google.gerrit.client.groups.GroupMap; import com.google.gerrit.client.rpc.GerritCallback; import com.google.gerrit.client.ui.AccountScreen; import com.google.gerrit.client.ui.FilteredUserInterface; +import com.google.gerrit.client.ui.Hyperlink; import com.google.gerrit.client.ui.IgnoreOutdatedFilterResultsCallbackWrapper; import com.google.gerrit.common.PageLinks; +import com.google.gerrit.reviewdb.client.AccountGeneralPreferences; import com.google.gwt.event.dom.client.KeyCodes; import com.google.gwt.event.dom.client.KeyUpEvent; import com.google.gwt.event.dom.client.KeyUpHandler; @@ -32,11 +34,16 @@ import com.google.gwt.user.client.ui.Label; import com.google.gwtexpui.globalkey.client.NpTextBox; public class GroupListScreen extends AccountScreen implements FilteredUserInterface { + private Hyperlink prev; + private Hyperlink next; private GroupTable groups; private NpTextBox filterTxt; private String subname = ""; + private int startPosition; + private int pageSize; public GroupListScreen() { + configurePageSize(); } public GroupListScreen(String params) { @@ -49,6 +56,22 @@ public class GroupListScreen extends AccountScreen implements FilteredUserInterf if ("filter".equals(kv[0])) { subname = URL.decodeQueryString(kv[1]); } + + if ("skip".equals(kv[0]) && URL.decodeQueryString(kv[1]).matches("^[\\d]+")) { + startPosition = Integer.parseInt(URL.decodeQueryString(kv[1])); + } + } + configurePageSize(); + } + + private void configurePageSize() { + if (Gerrit.isSignedIn()) { + final AccountGeneralPreferences p = + Gerrit.getUserAccount().getGeneralPreferences(); + final short m = p.getMaximumPageSize(); + pageSize = 0 < m ? m : AccountGeneralPreferences.DEFAULT_PAGESIZE; + } else { + pageSize = AccountGeneralPreferences.DEFAULT_PAGESIZE; } } @@ -56,13 +79,17 @@ public class GroupListScreen extends AccountScreen implements FilteredUserInterf protected void onLoad() { super.onLoad(); display(); - refresh(false); + refresh(false, false); } - private void refresh(final boolean open) { - setToken(subname == null || "".equals(subname) ? ADMIN_GROUPS - : ADMIN_GROUPS + "?filter=" + URL.encodeQueryString(subname)); - GroupMap.match(subname, + private void refresh(final boolean open, final boolean filterModified) { + if (filterModified){ + startPosition = 0; + } + setToken(getTokenForScreen(subname, startPosition)); + // Retrieve one more group than page size to determine if there are more + // groups to display + GroupMap.match(subname, pageSize + 1, startPosition, new IgnoreOutdatedFilterResultsCallbackWrapper(this, new GerritCallback() { @Override @@ -71,13 +98,45 @@ public class GroupListScreen extends AccountScreen implements FilteredUserInterf Gerrit.display(PageLinks.toGroup( result.values().get(0).getGroupUUID())); } else { - groups.display(result, subname); + if (result.size() <= pageSize) { + groups.display(result, subname); + next.setVisible(false); + } else { + groups.displaySubset(result, 0, result.size() - 1, subname); + setupNavigationLink(next, subname, startPosition + pageSize); + } + if (startPosition > 0) { + setupNavigationLink(prev, subname, startPosition - pageSize); + } else { + prev.setVisible(false); + } groups.finishDisplay(); } } })); } + private void setupNavigationLink(Hyperlink link, String filter, int skip) { + link.setTargetHistoryToken(getTokenForScreen(filter, skip)); + link.setVisible(true); + } + + private String getTokenForScreen(String filter, int skip) { + String token = ADMIN_GROUPS; + if (filter != null && !filter.isEmpty()) { + token += "?filter=" + URL.encodeQueryString(filter); + } + if (skip > 0) { + if (token.contains("?filter=")) { + token += ","; + } else { + token += "?"; + } + token += "skip=" + skip; + } + return token; + } + @Override public String getCurrentFilter() { return subname; @@ -89,8 +148,20 @@ public class GroupListScreen extends AccountScreen implements FilteredUserInterf setPageTitle(Util.C.groupListTitle()); initPageHeader(); + prev = new Hyperlink(Util.C.pagedGroupListPrev(), true, ""); + prev.setVisible(false); + + next = new Hyperlink(Util.C.pagedGroupListNext(), true, ""); + next.setVisible(false); + groups = new GroupTable(PageLinks.ADMIN_GROUPS); add(groups); + + final HorizontalPanel buttons = new HorizontalPanel(); + buttons.setStyleName(Gerrit.RESOURCES.css().changeTablePrevNextLinks()); + buttons.add(prev); + buttons.add(next); + add(buttons); } private void initPageHeader() { @@ -106,9 +177,10 @@ public class GroupListScreen extends AccountScreen implements FilteredUserInterf public void onKeyUp(KeyUpEvent event) { boolean enterPressed = event.getNativeEvent().getKeyCode() == KeyCodes.KEY_ENTER; - if (enterPressed || !filterTxt.getValue().equals(subname)) { + boolean filterModified = !filterTxt.getValue().equals(subname); + if (enterPressed || filterModified) { subname = filterTxt.getValue(); - refresh(enterPressed); + refresh(enterPressed, filterModified); } } }); diff --git a/gerrit-gwtui/src/main/java/com/google/gerrit/client/admin/GroupTable.java b/gerrit-gwtui/src/main/java/com/google/gerrit/client/admin/GroupTable.java index de840813b6..1b420b4e51 100644 --- a/gerrit-gwtui/src/main/java/com/google/gerrit/client/admin/GroupTable.java +++ b/gerrit-gwtui/src/main/java/com/google/gerrit/client/admin/GroupTable.java @@ -95,6 +95,14 @@ public class GroupTable extends NavigationTable { } public void display(List list, String toHighlight) { + displaySubset(list, toHighlight, 0, list.size()); + } + + public void displaySubset(GroupMap groups, int fromIndex, int toIndex, String toHighlight) { + displaySubset(Natives.asList(groups.values()), toHighlight, fromIndex, toIndex); + } + + public void displaySubset(List list, String toHighlight, int fromIndex, int toIndex) { while (1 < table.getRowCount()) table.removeRow(table.getRowCount() - 1); @@ -104,7 +112,7 @@ public class GroupTable extends NavigationTable { return a.name().compareTo(b.name()); } }); - for(GroupInfo group : list) { + for(GroupInfo group : list.subList(fromIndex, toIndex)) { final int row = table.getRowCount(); table.insertRow(row); applyDataRowStyle(row); diff --git a/gerrit-gwtui/src/main/java/com/google/gerrit/client/groups/GroupMap.java b/gerrit-gwtui/src/main/java/com/google/gerrit/client/groups/GroupMap.java index 6ba00ae643..f28fb8649a 100644 --- a/gerrit-gwtui/src/main/java/com/google/gerrit/client/groups/GroupMap.java +++ b/gerrit-gwtui/src/main/java/com/google/gerrit/client/groups/GroupMap.java @@ -24,12 +24,18 @@ public class GroupMap extends NativeMap { groups().get(NativeMap.copyKeysIntoChildren(callback)); } - public static void match(String match, AsyncCallback cb) { - if (match == null || "".equals(match)) { - all(cb); - } else { - groups().addParameter("m", match).get(NativeMap.copyKeysIntoChildren(cb)); + public static void match(String match, int limit, int start, AsyncCallback cb) { + RestApi call = groups(); + if (match != null) { + call.addParameter("m", match); } + if (limit > 0) { + call.addParameter("n", limit); + } + if (start > 0) { + call.addParameter("S", start); + } + call.get(NativeMap.copyKeysIntoChildren(cb)); } public static void myOwned(AsyncCallback cb) { From 77bb62076c5a02af992fb4434e43a0250ac59790 Mon Sep 17 00:00:00 2001 From: Bruce Zu Date: Tue, 15 Apr 2014 15:39:44 +0800 Subject: [PATCH 7/7] Enable automatic close changes on 'refs/meta/config' Bug: issue 2569 Change-Id: Ic192daa21cfcc1f26fa9f00feb14f41013a29fb9 --- .../java/com/google/gerrit/server/git/ReceiveCommits.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/git/ReceiveCommits.java b/gerrit-server/src/main/java/com/google/gerrit/server/git/ReceiveCommits.java index b2b810eec9..52e017bd98 100644 --- a/gerrit-server/src/main/java/com/google/gerrit/server/git/ReceiveCommits.java +++ b/gerrit-server/src/main/java/com/google/gerrit/server/git/ReceiveCommits.java @@ -550,7 +550,7 @@ public class ReceiveCommits { if (c.getResult() == OK) { switch (c.getType()) { case CREATE: - if (isHead(c)) { + if (isHead(c) || isConfig(c)) { autoCloseChanges(c); } break; @@ -560,13 +560,13 @@ public class ReceiveCommits { c.getRefName(), c.getOldId(), c.getNewId()); - if (isHead(c)) { + if (isHead(c) || isConfig(c)) { autoCloseChanges(c); } break; case UPDATE_NONFASTFORWARD: - if (isHead(c)) { + if (isHead(c) || isConfig(c)) { autoCloseChanges(c); } break;