Actually return failure to clients if new change creation failed

If a new change creation failed we were overwriting the result
with OK, which was wrong.  The client should know we rejected
the push as something failed our end.

Signed-off-by: Shawn O. Pearce <sop@google.com>
This commit is contained in:
Shawn O. Pearce
2009-02-13 18:57:07 -08:00
parent 22d14b8885
commit 2761a28d3d

View File

@@ -585,9 +585,11 @@ class Receive extends AbstractGitCommand {
} catch (IOException e) {
log.error("Error computing patch of commit " + c.name(), e);
reject(newChange, "diff error");
return;
} catch (OrmException e) {
log.error("Error creating change for commit " + c.name(), e);
reject(newChange, "database error");
return;
}
}
newChange.setResult(ReceiveCommand.Result.OK);