Don't error out on upload if we are only replacing a patch set
The "repo upload" client always sends us a refs/for/$branch command, even if the client is only trying to add a new patch set to an already existing change entity. It does so because this simplifies the client logic from needing to handle the case of "replacing everything" vs. "replacing some, creating some". We shouldn't consider it an error if the client didn't ask us to make anything new, but did supply at least one patch set replace to us. Noticed-by: jbq Signed-off-by: Shawn O. Pearce <sop@google.com>
This commit is contained in:
@@ -456,7 +456,7 @@ class Receive extends AbstractGitCommand {
|
||||
log.error("Invalid pack upload; one or more objects weren't sent", e);
|
||||
}
|
||||
|
||||
if (toCreate.isEmpty()) {
|
||||
if (toCreate.isEmpty() && addByChange.isEmpty()) {
|
||||
reject(newChange, "no new changes");
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user