-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle deletion of default directory while cloning
Also handle addition of children.
- Loading branch information
Showing
3 changed files
with
11 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 8 additions & 3 deletions
11
src/GitS-Core.package/GSGitWorkingCopy.class/class/requestFSReferenceForName..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,15 @@ | ||
instance creation | ||
requestFSReferenceForName: aString | ||
| defaultDirectory defaultDirectoryExisted defaultDirectoryReference chosen | | ||
| defaultDirectory defaultDirectoryExisted defaultDirectoryReference chosen chosenReference | | ||
defaultDirectory := self defaultDirectoryForName: aString. | ||
defaultDirectoryExisted := defaultDirectory exists. | ||
defaultDirectoryReference := defaultDirectory asFSReference. | ||
defaultDirectoryReference ensureCreateDirectory. | ||
chosen := UIManager default chooseDirectory: 'Repository location:' from: defaultDirectory. | ||
(defaultDirectoryExisted not and: [chosen ~= defaultDirectory]) ifTrue: [defaultDirectoryReference delete]. | ||
^ chosen ifNotNil: #asFSReference | ||
(defaultDirectoryExisted not | ||
and: [chosen ~= defaultDirectory] | ||
and: [defaultDirectoryReference isDirectory] | ||
and: [defaultDirectoryReference children isEmpty]) ifTrue: [defaultDirectoryReference delete]. | ||
chosenReference := chosen ifNotNil: #asFSReference. | ||
chosenReference ifNotNil: #ensureCreateDirectory. "might be deleted during popup" | ||
^ chosenReference |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters