localrepo: Fix commit error handling when name contains invalid chars
6da385c8 (Merge branch 'jc/commit-files-with-git-1' into 'master', 2023-06-15) added error handling to return a sentinel error when we detected that git gave us a "disallowed characters error". However, we added it to the wrong function as it's commit-tree(1) that is the one that returns that error.
gitlab!123427 (closed) is a full rails pipeline