CommitView: move index functions to separate controller

This merges functionality that was previously stored in the
combination of PBGitCommitController / PBChangedFile to a
dedicated controller, PBGitIndexController.
This commit is contained in:
Pieter de Bie
2008-11-18 23:29:11 +01:00
parent 874737fcb5
commit 0975426f2f
14 changed files with 507 additions and 221 deletions
+3 -3
View File
@@ -2,7 +2,7 @@ var showNewFile = function(file)
{
$('title').innerHTML = "New file: " + file.path;
var contents = file.unstagedChanges();
var contents = IndexController.unstagedChangesForFile_(file);
if (!contents) {
notify("Can not display changes (Binary file?)", -1);
return;
@@ -36,11 +36,11 @@ var showFileChanges = function(file, cached) {
var changes;
if (cached) {
$("title").innerHTML = "Staged changes for " + file.path;
changes = file.cachedChangesAmend_(Controller.amend());
changes = IndexController.stagedChangesForFile_(file);
}
else {
$("title").innerHTML = "Unstaged changes for " + file.path;
changes = file.unstagedChanges();
changes = IndexController.unstagedChangesForFile_(file);
}
if (changes == "") {