Zip file download of branch/tag with slash in name causes multiple levels in ZIP

Summary

Zip file download of branch/tag with slash in name causes multiple levels in ZIP GitLab 8.17.6-ee

Steps to reproduce

  1. Create a branch called "test/slash"
  2. Attempt to download a zip for the branch
  3. The Zip file contains a nested structure -

projectname-test - slash

  1. Download a different branch, with no slashes
  2. Zip file does not contain a nested structure.

It looks like the slash in the branch is causing zip to treat it as another folder.

Results of GitLab environment info

GitLab 8.17.6-ee GitLab Shell 4.1.1 GitLab Workhorse v1.3.0 GitLab API v4 Git 2.13.0 Ruby 2.3.0p0 Rails 4.2.7.1 mysql2

Assignee Loading
Time tracking Loading