Add support for locking branches.