git_update: clean up the code