Skip to content

Parse update-ref error from Prepare prior to escaping it

Sami Hiltunen requested to merge smh-update-ref-error-parsing into master

Prepare is parsing the error returned from setState to return a typed error. The error returned from setState has already escaped the stderr though. This results in reference names which have characters that would be escaped to be reported back to the caller incorrectly. For example, 'refs/heads\main' would be reported back as 'refs/heads\\main'. Fix this by parsing the error already in setState prior to escaping.

refLockedRegex was tightened up as the same 'cannot lock ref' matches more than one error and would change behavior of commit otherwise. The new regex matches only the expected error.

Edited by Sami Hiltunen

Merge request reports