Allow external diffs to be used conditionally Closes #54670 See merge request gitlab-org/gitlab-ce!25432