Uploading images to non-master branch in repository view uploading to root path

Summary

When trying to upload a file to a non-master branch through the repository UI, the file is not uploaded in the directory, but rather to the root of the project on that branch.

Steps to reproduce

Create a branch on a project and navigate several directories deep. Then click the + icon and upload file for that directory. Upon successful commit of the change you're directed to the project root where the file has been uploaded.

Example Project

https://gitlab.com/phikai/my-public-test-project/-/tree/test-upload

That branch shows a recent upload where this behavior was observed.

What is the current bug behavior?

Items uploaded are uploaded in the wrong directory.

What is the expected correct behavior?

Uploads should happen to the directory specified.

Relevant logs and/or screenshots

Screen recording example of issue occurring

Edited by Kai Armstrong