Skip to content

Commit

Permalink
Merge pull request #1748 from pharo-vcs/feature/honouring-proxy-settings
Browse files Browse the repository at this point in the history
Adding support for Proxy URL
  • Loading branch information
tesonep authored Oct 23, 2023
2 parents 989c418 + 13fb372 commit 94eb5b7
Show file tree
Hide file tree
Showing 139 changed files with 1,881 additions and 1,481 deletions.
2 changes: 1 addition & 1 deletion BaselineOfIceberg/BaselineOfIceberg.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ BaselineOfIceberg >> libgit: spec [
baseline: 'LibGit'
with: [
spec
repository: 'github://pharo-vcs/libgit2-pharo-bindings:v3.0.7';
repository: 'github://pharo-vcs/libgit2-pharo-bindings:v3.0.8';
loads: 'default' ].
spec
project: 'LibGit-Tests'
Expand Down
12 changes: 7 additions & 5 deletions Iceberg-Libgit/IceBranchNotFound.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,22 @@
A branch was not found.
"
Class {
#name : #IceBranchNotFound,
#superclass : #IceError,
#name : 'IceBranchNotFound',
#superclass : 'IceError',
#instVars : [
'branchName'
],
#category : #'Iceberg-Libgit-Exceptions'
#category : 'Iceberg-Libgit-Exceptions',
#package : 'Iceberg-Libgit',
#tag : 'Exceptions'
}

{ #category : #accessing }
{ #category : 'accessing' }
IceBranchNotFound >> branchName [
^ branchName
]

{ #category : #accessing }
{ #category : 'accessing' }
IceBranchNotFound >> branchName: aString [
branchName := aString
]
4 changes: 2 additions & 2 deletions Iceberg-Libgit/IceChangeImporter.extension.st
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Extension { #name : #IceChangeImporter }
Extension { #name : 'IceChangeImporter' }

{ #category : #'*Iceberg-Libgit' }
{ #category : '*Iceberg-Libgit' }
IceChangeImporter >> visitGitChange: anIceGitChange [

| importer |
Expand Down
10 changes: 6 additions & 4 deletions Iceberg-Libgit/IceCloneError.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@
Error while cloning a project
"
Class {
#name : #IceCloneError,
#superclass : #IceError,
#category : #'Iceberg-Libgit-Exceptions'
#name : 'IceCloneError',
#superclass : 'IceError',
#category : 'Iceberg-Libgit-Exceptions',
#package : 'Iceberg-Libgit',
#tag : 'Exceptions'
}

{ #category : #signalling }
{ #category : 'signalling' }
IceCloneError class >> signalFor: anObject [

^ self subclassResponsibility
Expand Down
16 changes: 9 additions & 7 deletions Iceberg-Libgit/IceCloneLocationAlreadyExists.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,34 @@ Error while cloning a project - the location on disk already exists
"
Class {
#name : #IceCloneLocationAlreadyExists,
#superclass : #IceCloneError,
#name : 'IceCloneLocationAlreadyExists',
#superclass : 'IceCloneError',
#instVars : [
'location'
],
#category : #'Iceberg-Libgit-Exceptions'
#category : 'Iceberg-Libgit-Exceptions',
#package : 'Iceberg-Libgit',
#tag : 'Exceptions'
}

{ #category : #signalling }
{ #category : 'signalling' }
IceCloneLocationAlreadyExists class >> signalFor: aLocation [
^ self new
location: aLocation;
signal.
]

{ #category : #visiting }
{ #category : 'visiting' }
IceCloneLocationAlreadyExists >> acceptError: aVisitor [
aVisitor visitCloneLocationAlreadyExists: self.
]

{ #category : #accessing }
{ #category : 'accessing' }
IceCloneLocationAlreadyExists >> location [
^ location
]

{ #category : #accessing }
{ #category : 'accessing' }
IceCloneLocationAlreadyExists >> location: anObject [
location := anObject
]
16 changes: 9 additions & 7 deletions Iceberg-Libgit/IceCloneRemoteNotFound.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,34 @@
The remote was not found
"
Class {
#name : #IceCloneRemoteNotFound,
#superclass : #IceCloneError,
#name : 'IceCloneRemoteNotFound',
#superclass : 'IceCloneError',
#instVars : [
'remoteUrl'
],
#category : #'Iceberg-Libgit-Exceptions'
#category : 'Iceberg-Libgit-Exceptions',
#package : 'Iceberg-Libgit',
#tag : 'Exceptions'
}

{ #category : #signalling }
{ #category : 'signalling' }
IceCloneRemoteNotFound class >> signalFor: aUrl [
^ self new
remoteUrl: aUrl;
signal.
]

{ #category : #visiting }
{ #category : 'visiting' }
IceCloneRemoteNotFound >> acceptError: aVisitor [
aVisitor visitCloneRemoteNotFound: self.
]

{ #category : #accessing }
{ #category : 'accessing' }
IceCloneRemoteNotFound >> remoteUrl [
^ remoteUrl
]

{ #category : #accessing }
{ #category : 'accessing' }
IceCloneRemoteNotFound >> remoteUrl: anObject [
remoteUrl := anObject
]
22 changes: 12 additions & 10 deletions Iceberg-Libgit/IceGitChange.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -2,51 +2,53 @@
I represent a change coming from git (in contrast to a change coming from the image). I know the changed file and I can be visited to define the create a more detailed diff.
"
Class {
#name : #IceGitChange,
#superclass : #IceChange,
#name : 'IceGitChange',
#superclass : 'IceChange',
#instVars : [
'filePathString'
],
#category : #'Iceberg-Libgit-Changes'
#category : 'Iceberg-Libgit-Changes',
#package : 'Iceberg-Libgit',
#tag : 'Changes'
}

{ #category : #accessing }
{ #category : 'accessing' }
IceGitChange class >> on: aString [

^ self new
filePathString: aString;
yourself
]

{ #category : #visiting }
{ #category : 'visiting' }
IceGitChange >> accept: aVisitor [

^ aVisitor visitGitChange: self
]

{ #category : #accessing }
{ #category : 'accessing' }
IceGitChange >> child [

^ IceGitChange on: (RelativePath withAll: self path segments allButFirst) pathString
]

{ #category : #displaying }
{ #category : 'displaying' }
IceGitChange >> displayingProgressString [
^ 'Comparing changes of ' , filePathString
]

{ #category : #accessing }
{ #category : 'accessing' }
IceGitChange >> filePathString: aString [
filePathString := aString
]

{ #category : #accessing }
{ #category : 'accessing' }
IceGitChange >> path [

^ Path from: filePathString
]

{ #category : #printing }
{ #category : 'printing' }
IceGitChange >> printOn: aStream [

aStream
Expand Down
24 changes: 13 additions & 11 deletions Iceberg-Libgit/IceGitChangeImporter.class.st
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
Class {
#name : #IceGitChangeImporter,
#superclass : #Object,
#name : 'IceGitChangeImporter',
#superclass : 'Object',
#instVars : [
'path',
'diff',
'version'
],
#category : #'Iceberg-Libgit-Changes'
#category : 'Iceberg-Libgit-Changes',
#package : 'Iceberg-Libgit',
#tag : 'Changes'
}

{ #category : #accessing }
{ #category : 'accessing' }
IceGitChangeImporter >> diff: anIceDiff [
diff := anIceDiff
]

{ #category : #building }
{ #category : 'building' }
IceGitChangeImporter >> ensureDirectory: aFileReference inParentNode: aNode [

aNode childAt: aFileReference basename ifPresent: [ :node |
Expand All @@ -23,7 +25,7 @@ IceGitChangeImporter >> ensureDirectory: aFileReference inParentNode: aNode [
^ aNode addChild: (IceDirectoryDefinition named: aFileReference basename path: aNode path / aFileReference basename)
]

{ #category : #building }
{ #category : 'building' }
IceGitChangeImporter >> ensurePackageFromDirectory: aFileReference inParentNode: aParentNode [

| importer packageName package |
Expand All @@ -45,7 +47,7 @@ IceGitChangeImporter >> ensurePackageFromDirectory: aFileReference inParentNode:
^ importer importOn: aParentNode
]

{ #category : #importing }
{ #category : 'importing' }
IceGitChangeImporter >> importOn: aNode [

| currentSegment fileReference filePath |
Expand Down Expand Up @@ -84,7 +86,7 @@ IceGitChangeImporter >> importOn: aNode [
"If path size = 0 we should stop recursion"
]

{ #category : #building }
{ #category : 'building' }
IceGitChangeImporter >> nextPath [

^ IceGitChangeImporter new
Expand All @@ -94,18 +96,18 @@ IceGitChangeImporter >> nextPath [
yourself.
]

{ #category : #accessing }
{ #category : 'accessing' }
IceGitChangeImporter >> path: aRelativePath [
path := aRelativePath
]

{ #category : #accessing }
{ #category : 'accessing' }
IceGitChangeImporter >> repository [

^ diff repository
]

{ #category : #accessing }
{ #category : 'accessing' }
IceGitChangeImporter >> version: aVersion [

version := aVersion
Expand Down
22 changes: 13 additions & 9 deletions Iceberg-Libgit/IceGitClone.class.st
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
Class {
#name : #IceGitClone,
#superclass : #Object,
#name : 'IceGitClone',
#superclass : 'Object',
#instVars : [
'location',
'url'
],
#category : #'Iceberg-Libgit-GitActions'
#category : 'Iceberg-Libgit-GitActions',
#package : 'Iceberg-Libgit',
#tag : 'GitActions'
}

{ #category : #'private - operations' }
{ #category : 'private - operations' }
IceGitClone >> cloneRepo: repo cloneOptions: cloneOptions remainingRetries: remainingRetries [

[repo clone: url options: cloneOptions]
Expand All @@ -22,7 +24,7 @@ IceGitClone >> cloneRepo: repo cloneOptions: cloneOptions remainingRetries: rema

]

{ #category : #actions }
{ #category : 'actions' }
IceGitClone >> execute [

| repo cloneOptions checkoutOptions callbacks |
Expand All @@ -34,6 +36,8 @@ IceGitClone >> execute [
repo := LGitRepository on: location.
cloneOptions := repo cloneOptionsStructureClass withCredentialsProvider: (IceCredentialsProvider defaultForRemoteUrl: url).

Iceberg configureLGitProxyOpt: cloneOptions fetchOptions proxyOptions.

"Keeping references, because if not the GC take them."
checkoutOptions := cloneOptions checkoutOptions.
callbacks := cloneOptions fetchOptions callbacks.
Expand All @@ -53,22 +57,22 @@ IceGitClone >> execute [
error acceptError: (IceLibgitErrorVisitor onContext: self) ]
]

{ #category : #accessing }
{ #category : 'accessing' }
IceGitClone >> location [
^ location
]

{ #category : #accessing }
{ #category : 'accessing' }
IceGitClone >> location: aFileReference [
location := aFileReference
]

{ #category : #accessing }
{ #category : 'accessing' }
IceGitClone >> url [
^ url
]

{ #category : #accessing }
{ #category : 'accessing' }
IceGitClone >> url: aString [
url := aString
]
Loading

0 comments on commit 94eb5b7

Please sign in to comment.