Skip to content

Fix "could not find out if split diff is enabled" on commented snippet

Administrator requested to merge split-diff-exception into master

Created by: lguychard

Fixes #3480

Split diff detection, used on hover through getDiffCodePart(), getCodeElementFromLineNumber(), would inevitably throw an exception on PR commented snippets, because it relied on the presence of a toolbar allowing to switch between split diff / unified diff, which does not exist on PR discussions pages (commented snippets are always shown as a unified diff).

To fix this:

I added fixtures for newly handled cases: pull request discussion * (GitHub.com, ghe) * (vanilla, refined GitHub).

Code Hosts
  • GitHub
  • GitHub Enterprise
  • Refined GitHub
Browsers
  • Chrome

Merge request reports

Loading