[PATCH] Generic support for pulling refs