-
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.
Propose a remote name when adding a new remote
Closes #205
- Loading branch information
Showing
5 changed files
with
29 additions
and
4 deletions.
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
src/Squit.package/SquitInteractiveAddRemote.class/class/repository..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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
instance creation | ||
repository: aSquitRepository | ||
^ self new | ||
repository: aSquitRepository; | ||
yourself |
4 changes: 4 additions & 0 deletions
4
src/Squit.package/SquitInteractiveAddRemote.class/instance/initializeQuery.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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
running | ||
initializeQuery | ||
query := SquitAddRemote new. | ||
query remoteName: self proposedRemoteName. |
13 changes: 13 additions & 0 deletions
13
src/Squit.package/SquitInteractiveAddRemote.class/instance/proposedRemoteName.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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
running | ||
proposedRemoteName | ||
| suggestion isFirstRemote isGitHubUrl | | ||
isFirstRemote := self repository remoteNames isEmpty. | ||
isFirstRemote | ||
ifTrue: [suggestion := 'origin'] | ||
ifFalse: | ||
[isGitHubUrl := query remoteUrl includesSubstring: '://github.com/'. | ||
isGitHubUrl ifTrue: | ||
[ | repoOwner | repoOwner := (query remoteUrl splitBy: '/') at: 4 ifAbsent: []. | ||
suggestion := repoOwner]]. | ||
(self repository remoteNames includes: suggestion) ifTrue: [suggestion := nil]. | ||
^ suggestion ifNil: [''] |
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
6 changes: 4 additions & 2 deletions
6
src/Squit.package/SquitInteractiveAddRemote.class/methodProperties.json
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,15 +1,17 @@ | ||
{ | ||
"class" : { | ||
}, | ||
"repository:" : "jr 8/30/2020 19:26" }, | ||
"instance" : { | ||
"fetch" : "jr 7/1/2020 21:52", | ||
"initializeQuery" : "jr 8/30/2020 19:32", | ||
"notifyRemoteAdded" : "jr 7/1/2020 21:41", | ||
"notifyRollback" : "jr 7/1/2020 21:42", | ||
"onQueryClose:" : "jr 8/8/2020 00:00", | ||
"onRemoteAddedDo:" : "jr 7/1/2020 21:39", | ||
"onRollbackDo:" : "jr 7/1/2020 21:40", | ||
"proposedRemoteName" : "jr 8/30/2020 20:01", | ||
"requestFetchFromRemoteNamed:" : "jr 8/8/2020 00:00", | ||
"requestRemoteDetails" : "jr 7/1/2020 21:32", | ||
"retry" : "jr 7/1/2020 21:32", | ||
"run" : "jr 7/21/2020 12:49", | ||
"run" : "jr 8/30/2020 19:34", | ||
"undo" : "jr 7/1/2020 21:54" } } |