Fix undefined $repository
Auditors: btrahan
This code feels a little weird, but I guess since we can have Differential diffs with no associated repository it makes sense.