Edit button on compare page doesn't work when you need to fork the project
Summary
When working on !124531 (closed), I noticed that the edit button does absolutely nothing when the edit_fork_button_tag
is rendered.
Steps to reproduce
- Go to a public project that you aren't a member of and don't have a fork of.
- Go to the branches page of that project and compare two branches
- Click the edit button at the top of a compared file.
Example Project
This page should show the problem, but depending on your permissions, it may not. samdbeckham/test@master...new-branch
Another example: https://gitlab.com/fdroid/fdroiddata/-/compare/master...2887-fatal-couldn-t-find-remote-ref-xxx-master
What is the current bug behavior?
Absolutely nothing happens
What is the expected correct behavior?
I'm not sure exactly, though it should probably create a fork and edit that file in a fork.
Relevant logs and/or screenshots
Output of checks
This bug happens on GitLab.com
Possible fixes
https://gitlab.com/gitlab-org/gitlab/-/blob/29f6bb046cc690116ed47ea4bd8257d9a5f44f22/app/helpers/blob_helper.rb#L308 is where it's rendered, but I'm not sure what the fix could be.
Workaround
Fork repository from repository page.
Edited by Jay McCure