[EGIT PATCH 24/31] Clone wizard: force dir to suggested path only if repo selection change

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When user moves backward in wizard from destination page to source
branch selection, then moves forward, we shouldn't overwrite his/her
directory selection in destination page.
Let's do it only when repository selection changes.

Signed-off-by: Marek Zawirski <marek.zawirski@xxxxxxxxx>
---
 .../ui/internal/clone/CloneDestinationPage.java    |   16 ++++++++++------
 1 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/clone/CloneDestinationPage.java b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/clone/CloneDestinationPage.java
index 97f166a..508781d 100644
--- a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/clone/CloneDestinationPage.java
+++ b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/clone/CloneDestinationPage.java
@@ -278,15 +278,19 @@ class CloneDestinationPage extends WizardPage {
 			checkPage();
 			return;
 		}
-		validatedRepoSelection = sourcePage.getSelection();
+		
+		if (!sourcePage.selectionEquals(validatedRepoSelection)) {
+			validatedRepoSelection = sourcePage.getSelection();
+			// update repo-related selection only if it changed
+			final String n = getSuggestedName();
+			setDescription(NLS.bind(UIText.CloneDestinationPage_description, n));
+			directoryText.setText(new File(ResourcesPlugin.getWorkspace()
+					.getRoot().getRawLocation().toFile(), n).getAbsolutePath());
+		}
+		
 		validatedSelectedBranches = branchPage.getSelectedBranches();
 		validatedHEAD = branchPage.getHEAD();
 
-		final String n = getSuggestedName();
-		setDescription(NLS.bind(UIText.CloneDestinationPage_description, n));
-		directoryText.setText(new File(ResourcesPlugin.getWorkspace().getRoot()
-				.getRawLocation().toFile(), n).getAbsolutePath());
-
 		initialBranch.removeAll();
 		final Ref head = branchPage.getHEAD();
 		int newix = 0;
-- 
1.5.6.3

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux