Improve script for fast-forwarding branches