Uploading a new file from Web UI can push to "undefined" branch

While trying to fix https://gitlab.com/gitlab-org/gitlab-ce/issues/45350#note_68536487, I noticed that the branch used by the Web UI may be undefined when a fork is automatically created. Steps to reproduce:

  1. Make a project "Public"
  2. Ensure user testme doesn't have any permissions for that group
  3. Go to project repository view, click "+", "Upload file"
  4. Project will be forked automatically. Repeat step 3.
  5. The dropdown won't have a "branch" name, so you don't see the usual branch name:

image

Notice the branch is undefined:

image

I think it should be a frontend change that shows the branch name if the user doesn't have access to push directly to the public repository.

Assignee Loading
Time tracking Loading