Skip to content

Impossible to comment on a diff with a former symlink

Summary

Impossible to comment on a diff with a former symlink

Steps to reproduce

Replace symlink with a file with content

Example Project

Try to comment on "crash me" line in a MR diff here: redbaron1/diffbug!1 (diffs)

What is the current bug behavior?

Comments are impossible, Errors in JS console

JS backtrace:

TypeError: Cannot set property 'hasForm' of undefined
    at l.<anonymous> (pages.projects.merge_requests.show.a02b106a.chunk.js:1)
    at main.9abf037f.chunk.js:31
    at main.9abf037f.chunk.js:37
    at Array.forEach (<anonymous>)
    at main.9abf037f.chunk.js:37
    at l._withCommit (main.9abf037f.chunk.js:37)
    at l.commit (main.9abf037f.chunk.js:37)
    at l.commit (main.9abf037f.chunk.js:31)
    at r.commit (main.9abf037f.chunk.js:31)
    at l.U (pages.projects.merge_requests.show.a02b106a.chunk.js:1)
    at Array.<anonymous> (main.9abf037f.chunk.js:31)
    at l.dispatch (main.9abf037f.chunk.js:37)
    at l.dispatch (main.9abf037f.chunk.js:31)
    at l.r.dispatch (main.9abf037f.chunk.js:31)
    at a.S.forEach.n.<computed> (main.9abf037f.chunk.js:37)
    at a.handleCommentButton (pages.projects.merge_requests.show.a02b106a.chunk.js:1)
    at $e (main.9abf037f.chunk.js:31)
    at HTMLButtonElement.n (main.9abf037f.chunk.js:31)
    at HTMLButtonElement.o._wrapper (main.9abf037f.chunk.js:31)
    at HTMLButtonElement.a (raven.99383f35.chunk.js:1)

What is the expected correct behavior?

Comments work as expected

Output of checks

This bug happens on GitLab.com

Edited by Nick Thomas