Skip to content

Gracefully handle diff paths with leading slashes

If a user used the GitLab API to generate a discussion in a merge request diff with a leading slash in a path, Gitaly would pass in the path and cause Git to die. For example:

git diff HEAD^1 -- /filename
fatal: /filename: '/filename' is outside repository

We should just strip the leading slash to avoid this error.

Closes gitlab#207586 (closed)

Edited by Stan Hu

Merge request reports

Loading