Create the WIP branch if necessary and return the SHA of the latest commit from write_study()