diffHighlighter.js: Bail out early for deleted binary/image files

If we have an image (png,jpg,...) which was deleted we cant display a
diff or the file itself anymore. In this case the entry in the file-list
is enough.
This commit is contained in:
Johannes Gilger
2009-01-30 10:32:26 +01:00
parent 7cb4930389
commit 8bed6191f5
+10
View File
@@ -56,6 +56,16 @@ var highlightDiff = function(diff, element, callbacks) {
title = endname;
else if (startname != endname)
title = startname + " renamed to " + endname;
if (binary && endname == "/dev/null") { // in cases of a deleted binary file, there is no diff/file to display
line1 = "";
line2 = "";
diffContent = "";
file_index++;
startname = "";
endname = "";
return; // so printing the filename in the file-list is enough
}
finalContent += '<div class="file" id="file_index_' + (file_index - 1) + '">' +
'<div class="fileHeader">' + title + '</div>';