-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove the old remote when renaming a remote
- Loading branch information
Showing
2 changed files
with
11 additions
and
7 deletions.
There are no files selected for viewing
16 changes: 10 additions & 6 deletions
16
src/Squot.package/SquotRemotesBrowser.class/instance/actionEditRemote.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,14 @@ | ||
actions | ||
actionEditRemote | ||
self selectedRemoteName ifNil: [^ self]. | ||
self withUnitOfWork: [| remote | | ||
self withUnitOfWork: [| remote newRemote | | ||
remote := self selectedRemote. | ||
self addRemote: | ||
(SquotRemoteDialog | ||
getRemoteWithTitle: 'Edit Remote' | ||
name: remote name | ||
url: remote url)]. | ||
newRemote := SquotRemoteDialog | ||
getRemoteWithTitle: 'Edit Remote' | ||
name: remote name | ||
url: remote url. | ||
newRemote ifNotNil: [ | ||
newRemote name = remote name ifFalse: [ | ||
"only remove the remote if the name changes, otherwise the refs can be kept" | ||
self unitOfWork removeRemoteNamed: remote name]. | ||
self addRemote: newRemote]]. |
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