Skip to content

Commit

Permalink
Fix rejection of non-empty directories when adding existing repos
Browse files Browse the repository at this point in the history
  • Loading branch information
MariusDoe committed Jun 12, 2024
1 parent b8369c4 commit e447b42
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ cloneFromUserAndRegister
url := UIManager default request: 'URL to clone:'.
url isEmptyOrNil ifTrue: [^ nil].
name := (self nameFromURL: url) ifNil: [^ nil].
reference := (self requestFSReferenceForName: name) ifNil: [^ nil].
reference := (self requestEmptyFSReferenceForName: name) ifNil: [^ nil].
^ (self cloneFrom: url to: reference named: name)
register;
yourself
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
instance creation
requestEmptyFSReferenceForName: aString
| reference |
reference := (self requestFSReferenceForName: aString) ifNil: [^ nil].
reference children ifEmpty: [^ reference].
self inform: 'Please choose an empty directory.'.
^ self requestEmptyFSReferenceForName: aString
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,4 @@ requestFSReferenceForName: aString
defaultDirectoryReference ensureCreateDirectory.
chosen := UIManager default chooseDirectory: 'Repository location:' from: defaultDirectory.
(defaultDirectoryExisted not and: [chosen ~= defaultDirectory]) ifTrue: [defaultDirectoryReference delete].
^ chosen ifNotNil: [ | reference |
reference := chosen asFSReference.
reference children ifNotEmpty: [
self inform: 'Please choose an empty directory.'.
^ self requestFSReferenceForName: aString].
reference]
^ chosen ifNotNil: #asFSReference
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"class" : {
"basicImageHash" : "mad 11/29/2023 15:11",
"cloneFrom:to:named:" : "mad 9/19/2023 11:53",
"cloneFromUserAndRegister" : "mad 11/13/2023 12:09",
"cloneFromUserAndRegister" : "mad 6/12/2024 11:59",
"defaultDirectoryForName:" : "mad 10/22/2023 00:24",
"doPostUpdateMigrations" : "mad 11/21/2023 16:06",
"gitSuffix" : "mad 11/13/2023 12:03",
Expand All @@ -23,7 +23,8 @@
"registeredNames" : "mad 9/19/2023 12:16",
"registry" : "mad 9/19/2023 11:59",
"registry:" : "mad 9/19/2023 11:59",
"requestFSReferenceForName:" : "mad 5/23/2024 21:15",
"requestEmptyFSReferenceForName:" : "mad 6/12/2024 11:58",
"requestFSReferenceForName:" : "mad 6/12/2024 11:59",
"requestUnregisteredName" : "mad 11/13/2023 12:01",
"requestUnregisteredNameFrom:" : "mad 12/8/2023 19:56",
"requestUnregisteredNameFrom:title:" : "mad 12/8/2023 19:56",
Expand Down

0 comments on commit e447b42

Please sign in to comment.