Fix NPE during merge failure on new branch
The following caused an NPE in the submit queue:
1. Create a new project
2. Push change 1 to the new project
3. Push change 2 which depends on change 1 to the new project
4. (verify/approve) submit change 2
What happened was we processed change 2 without having change 1
in the submit queue. This lead us to give a "missing dependency"
error for change 2, which is reasonable. However the branch we are
submitting to does not yet exist, and nothing was submitted into it.
We still tried to create the branch, but with a null ObjectId.
Avoid branch creation if we have nothing to store in it yet.
Bug: issue 652
Change-Id: Ia4112bbb03526d8a75e0eba577c7f5a672bf7298
Signed-off-by: Shawn O. Pearce <sop@google.com>
1 file changed