CommitView: Handle new files better

This fixes the 'cat' command that was acting up and also shows
information when a file could not be displayed
This commit is contained in:
Pieter de Bie
2008-09-25 23:45:14 +02:00
parent d58127e6a2
commit 001b6bf10e
2 changed files with 8 additions and 2 deletions
+7 -1
View File
@@ -8,9 +8,15 @@
<script src="diff.js" type="text/javascript" charset="utf-8"></script>
<script>
var showFileChanges = function(file) {
// New file?
if (file.status == 0)
{
$("diff").innerHTML = file.changes();
var contents = file.changes();
if (contents)
$("diff").innerHTML = contents;
else
$("diff").innerHTML = "Could not display changes";
$("diff").show();
$('title').innerHTML = "New file: " + file.path;
} else {