Rev-parse: better error handling for chaining. Fixed an error where "nonexistant^N" or similar would fall into an assert. This now properly returns an error.