Don't try to auto-close changes on branch delete
On a branch delete, there's no changes to close. On branch create, there's no base commit. Signed-off-by: Shawn O. Pearce <sop@google.com>
This commit is contained in:
@@ -162,17 +162,19 @@ class Receive extends AbstractGitCommand {
|
|||||||
for (final ReceiveCommand c : commands) {
|
for (final ReceiveCommand c : commands) {
|
||||||
if (c.getResult() == Result.OK) {
|
if (c.getResult() == Result.OK) {
|
||||||
if (isHead(c)) {
|
if (isHead(c)) {
|
||||||
// Make sure the branch table matches the repository
|
|
||||||
//
|
|
||||||
switch (c.getType()) {
|
switch (c.getType()) {
|
||||||
case CREATE:
|
case CREATE:
|
||||||
insertBranchEntity(c);
|
insertBranchEntity(c);
|
||||||
|
autoCloseChanges(c);
|
||||||
break;
|
break;
|
||||||
case DELETE:
|
case DELETE:
|
||||||
deleteBranchEntity(c);
|
deleteBranchEntity(c);
|
||||||
break;
|
break;
|
||||||
|
case UPDATE:
|
||||||
|
case UPDATE_NONFASTFORWARD:
|
||||||
|
autoCloseChanges(c);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
autoCloseChanges(c);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isHead(c) || isTag(c)) {
|
if (isHead(c) || isTag(c)) {
|
||||||
@@ -1072,7 +1074,9 @@ class Receive extends AbstractGitCommand {
|
|||||||
try {
|
try {
|
||||||
rw.reset();
|
rw.reset();
|
||||||
rw.markStart(rw.parseCommit(cmd.getNewId()));
|
rw.markStart(rw.parseCommit(cmd.getNewId()));
|
||||||
rw.markUninteresting(rw.parseCommit(cmd.getOldId()));
|
if (!ObjectId.zeroId().equals(cmd.getOldId())) {
|
||||||
|
rw.markUninteresting(rw.parseCommit(cmd.getOldId()));
|
||||||
|
}
|
||||||
|
|
||||||
final Map<ObjectId, Ref> changes = changeRefsById();
|
final Map<ObjectId, Ref> changes = changeRefsById();
|
||||||
RevCommit c;
|
RevCommit c;
|
||||||
|
|||||||
Reference in New Issue
Block a user