Merge branch 'master' of ssh://sbrandys@git.eclipse.org/gitroot/orion/org.eclipse.orion.client.git
diff --git a/bundles/org.eclipse.orion.client.git/web/git/git-log.js b/bundles/org.eclipse.orion.client.git/web/git/git-log.js
index 75b11dd..faef988 100644
--- a/bundles/org.eclipse.orion.client.git/web/git/git-log.js
+++ b/bundles/org.eclipse.orion.client.git/web/git/git-log.js
@@ -106,6 +106,10 @@
 			var loadResource = function(resource){
 				var fileClient = new mFileClient.FileClient(serviceRegistry);
 				initTitleBar(fileClient, navigator, resource, searcher);
+				
+				// clear and close the commit details pane
+				navigator.loadCommitDetails(null);
+				
 				if (resource.Type === "RemoteTrackingBranch"){
 					var gitService = serviceRegistry.getService("orion.git.provider")
 					gitService.getLog(resource.HeadLocation, resource.Id, function(scopedCommitsJsonData, secondArg) {
diff --git a/bundles/org.eclipse.orion.client.git/web/orion/git/git-commit-details.js b/bundles/org.eclipse.orion.client.git/web/orion/git/git-commit-details.js
index f499a5f..9168f6b 100644
--- a/bundles/org.eclipse.orion.client.git/web/orion/git/git-commit-details.js
+++ b/bundles/org.eclipse.orion.client.git/web/orion/git/git-commit-details.js
@@ -55,9 +55,11 @@
 		loadCommitDetails: function(commitDetails){
 		
 			if(this._detailsPane){ //open details pane each time loading new details
-				if(!this._detailsPane.isRightPaneOpen()){
+				if(!this._detailsPane.isRightPaneOpen() && commitDetails != null)
 					this._detailsPane.toggle();
-				}
+				else if (this._detailsPane.isRightPaneOpen() && commitDetails == null)
+					this._detailsPane.toggle();
+				
 				this._detailsPane.style.overflow = "hidden";
 			}
 			this.render(commitDetails);