-
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.
Add support for remotes with non-HTTP(S) URLs via external git
- Loading branch information
Showing
13 changed files
with
58 additions
and
33 deletions.
There are no files selected for viewing
3 changes: 3 additions & 0 deletions
3
src/FileSystem-Git.package/FileSystemGitRepository.class/instance/canHandleUrlInternally..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,3 @@ | ||
git porcelain | ||
canHandleUrlInternally: aString | ||
^ {'http://'. 'https://'} anySatisfy: [:each | aString beginsWith: each] |
4 changes: 2 additions & 2 deletions
4
src/FileSystem-Git.package/FileSystemGitRepository.class/instance/cloneFrom..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,11 +1,11 @@ | ||
git porcelain | ||
cloneFrom: aStringOrUrl | ||
GitFeatureFlags externalFetchAndPush | ||
(self shouldHandleUrlExternally: aStringOrUrl) | ||
ifTrue: [self cloneExternalFrom: aStringOrUrl] | ||
ifFalse: [[self cloneInternalFrom: aStringOrUrl] | ||
on: ConnectionClosed | ||
do: [:exception | | ||
self | ||
handleConnectionClosed: exception | ||
whileTryingTo: 'clone' | ||
while: 'cloning' | ||
ifRetry: [self cloneFrom: aStringOrUrl]]]. |
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
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
7 changes: 7 additions & 0 deletions
7
...t.package/FileSystemGitRepository.class/instance/handleConnectionClosed.while.ifRetry..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,7 @@ | ||
git porcelain | ||
handleConnectionClosed: aConnectionClosed while: aString ifRetry: aBlock | ||
(self requestToEnableExternalFetchAndPushBecause: | ||
('{1} failed with the internal git implementation.' | ||
format: {aString capitalized})) | ||
ifFalse: [aConnectionClosed pass] | ||
ifTrue: [aBlock value]. |
18 changes: 0 additions & 18 deletions
18
...e/FileSystemGitRepository.class/instance/handleConnectionClosed.whileTryingTo.ifRetry..st
This file was deleted.
Oops, something went wrong.
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
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
17 changes: 17 additions & 0 deletions
17
...age/FileSystemGitRepository.class/instance/requestToEnableExternalFetchAndPushBecause..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,17 @@ | ||
git porcelain | ||
requestToEnableExternalFetchAndPushBecause: aString | ||
| preference answer | | ||
preference := Preferences | ||
pragmaPreferenceFor: GitFeatureFlags | ||
getter: #externalFetchAndPush. | ||
answer := (self confirm: | ||
('{1} Do you want to automatically use the git commandline? | ||
This will enable {2} to remember your decision.' | ||
withoutLineEndings withBlanksCondensed asText | ||
format: { | ||
aString. | ||
('a preference' asText | ||
addAttribute: (PluggableTextAttribute evalBlock: [preference open]); | ||
yourself)})). | ||
answer ifTrue: [preference preferenceValue: true]. | ||
^ answer |
9 changes: 9 additions & 0 deletions
9
...leSystem-Git.package/FileSystemGitRepository.class/instance/shouldHandleUrlExternally..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,9 @@ | ||
git porcelain | ||
shouldHandleUrlExternally: aString | ||
| errorMessage | | ||
GitFeatureFlags externalFetchAndPush ifTrue: [^ true]. | ||
(self canHandleUrlInternally: aString) ifTrue: [^ false]. | ||
errorMessage := 'The url {1} cannot be handled by the internal git implementation.' | ||
format: {aString printString}. | ||
(self requestToEnableExternalFetchAndPushBecause: errorMessage) ifTrue: [^ true]. | ||
self error: errorMessage. |
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: 2 additions & 4 deletions
6
src/GitS-Core.package/GSGitWorkingCopy.class/class/nameFromURL..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
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