Skip to content

Strip leading slashes in blob path to resolve filenames properly

This bug was found while testing this PR. Steps to reproduce:

  1. Pick a repository with a README.md.
  2. Go to the "Files" section
  3. Click on the "+" to create a new file
  4. In the filename field, type README.md. Then write a commit message and click on the "Commit Changes" button.

The file will be overwritten without warning, but it should have detected that the file existed and failed. The file path given to the Blob object was /README.md, which failed to resolve properly due to #12.

Closes #12

Closes https://github.com/gitlabhq/gitlabhq/issues/8253

Merge request reports