bug 379237 - Move diff sections under staged and unstaged sections
https://bugs.eclipse.org/bugs/show_bug.cgi?id=379237
diff --git a/bundles/org.eclipse.orion.client.git/web/orion/git/gitCommands.js b/bundles/org.eclipse.orion.client.git/web/orion/git/gitCommands.js
index 6dcefa6..82346df 100644
--- a/bundles/org.eclipse.orion.client.git/web/orion/git/gitCommands.js
+++ b/bundles/org.eclipse.orion.client.git/web/orion/git/gitCommands.js
@@ -2306,7 +2306,7 @@
 					return false;
 
 				for (var i = 0; i < items.length; i++) {
-					if (mGitUtil.isStaged(items[i]))
+					if (!mGitUtil.isChange(items[i]) || mGitUtil.isStaged(items[i]))
 						return false; 
 				}
 				return true;
@@ -2355,7 +2355,7 @@
 					return false;
 
 				for (var i = 0; i < items.length; i++) {
-					if (!mGitUtil.isStaged(items[i]))
+					if (!mGitUtil.isChange(items[i]) || !mGitUtil.isStaged(items[i]))
 						return false; 
 				}
 				return true;
@@ -2470,7 +2470,7 @@
 					return false;
 
 				for (var i = 0; i < items.length; i++) {
-					if (mGitUtil.isStaged(items[i]))
+					if (!mGitUtil.isChange(items[i]) || mGitUtil.isStaged(items[i]))
 						return false; 
 				}
 				return true;
diff --git a/bundles/org.eclipse.orion.client.git/web/orion/git/gitStatusExplorer.js b/bundles/org.eclipse.orion.client.git/web/orion/git/gitStatusExplorer.js
index 6501d2e..e84dfca 100644
--- a/bundles/org.eclipse.orion.client.git/web/orion/git/gitStatusExplorer.js
+++ b/bundles/org.eclipse.orion.client.git/web/orion/git/gitStatusExplorer.js
@@ -344,18 +344,18 @@
 						if (parentItem instanceof Array && parentItem.length > 0) {

 							onComplete(parentItem);

 						} else if (mGitUtil.isChange(parentItem)) {

-							onComplete([{"diffUri" : parentItem.diffURI, "Type": "Diff"}]);

+							onComplete([{"diffUri": parentItem.diffURI, "Type": "Diff", parent: parentItem}]);

 						} else {

 							onComplete([]);

 						}

 					},

 					getId: function(/* item */ item){

 						if (item instanceof Array && item.length > 0) {

-							return "root";

+							return "unstagedRoot";

 						} else if (mGitUtil.isChange(item)) {

-							return item.name;

+							return "unstaged" + item.name;

 						} else {

-							return item.diffUri;

+							return "unstaged" + item.diffUri;

 						}

 					}

 				};

@@ -399,7 +399,7 @@
 								var diffProvider = new mCompareContainer.DefaultDiffProvider(that.registry);

 								

 								var diffOptions = {

-									//commandSpanId: spanId,

+									commandSpanId: "unstaged" + item.parent.name + "actionswrapper",

 									diffProvider: diffProvider,

 									hasConflicts: false,

 									readonly: true,

@@ -417,7 +417,7 @@
 						break;

 					case 1:

 						if (item.type){

-							var actionsColumn = this.getActionsColumn(item, tableRow, null, null, true);

+							var actionsColumn = this.getActionsColumn({}, tableRow, null, null, true);

 							return actionsColumn;

 						}

 						

@@ -503,18 +503,18 @@
 						if (parentItem instanceof Array && parentItem.length > 0) {

 							onComplete(parentItem);

 						} else if (mGitUtil.isChange(parentItem)) {

-							onComplete([{"diffUri" : parentItem.diffURI, "Type": "Diff"}]);

+							onComplete([{"diffUri": parentItem.diffURI, "Type": "Diff", parent: parentItem}]);

 						} else {

 							onComplete([]);

 						}

 					},

 					getId: function(/* item */ item){

 						if (item instanceof Array && item.length > 0) {

-							return "root";

+							return "stagedRoot";

 						} else if (mGitUtil.isChange(item)) {

-							return item.name;

+							return "staged" + item.name;

 						} else {

-							return item.diffUri;

+							return "staged" + item.diffUri;

 						}

 					}

 				};

@@ -559,7 +559,7 @@
 								var diffProvider = new mCompareContainer.DefaultDiffProvider(that.registry);

 								

 								var diffOptions = {

-									//commandSpanId: diffSection.actionsNode.id,

+									commandSpanId: "staged" + item.parent.name + "actionswrapper",

 									diffProvider: diffProvider,

 									hasConflicts: false,

 									readonly: true,

@@ -577,7 +577,7 @@
 						break;

 					case 1:

 						if (item.type){

-							var actionsColumn = this.getActionsColumn(item, tableRow, null, null, true);

+							var actionsColumn = this.getActionsColumn({}, tableRow, null, null, true);

 							return actionsColumn;

 						}