Do not delete branches concurrently.

Deleting multiple branches from the UI was resulting in a 500 error when
branches are in the packed-refs. This was happening because for each
branch to be deleted, a separate DELETE request was fired to the server.
The concurrent deletion was failing because JGit was not able to lock
the pack-ref file to remove the branch from it since the first deletion
that was getting executed already locked the file.

Add REST API call to delete multiple branches and modify
ProjectApi.deleteBranch to use that new call. When multiple branches
are deleted from the UI, one request is sent to the server to delete
all the selected branches.

Bug: issue 2706
Change-Id: I786533eb57048b1c9c67a386f0be37bf1a39853f
5 files changed