mirror of
https://github.com/kennethreitz-archive/gitx.git
synced 2026-06-05 23:40:18 +00:00
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:
+7
-1
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user