Behavior of `--reference` flag with samtools sort
You would only need to supply a reference when using CRAM output encoding. The CRAM format allows storing entries without explicitly encoding the base calls, since one can instead encode the differences to the reference genome.

With BAM output the --reference option has no effect.