add ensure_current_master function; remove extraneous 'git checkout master'