Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
- configure remotes with the same protocol than the clone
- remove useless retry
  • Loading branch information
guillep committed Aug 10, 2018
1 parent 7927248 commit 2d16997
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
*Iceberg-Plugin-GitHub
githubRequestUrlKey

^ #'clone_url'
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"name" : "IceHttpsProtocol"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
*Iceberg-Plugin-GitHub
githubRequestUrlKey

^ #'ssh_url'
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"name" : "IceSSHProtocol"
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
querying-github
getGitHubRepository
"It will retry 3 times"
1 to: 3 do: [ :attempt |
[ [ ^ IceGitHubAPI new
beAnonymous;
getRepository: self userName project: self projectName ]
on: IceAuthenticationError do: [ "I will retry." ] ]
on: LGitNoCredentialsProvided do: [ ^ nil ] ].
^ nil
[ ^ IceGitHubAPI new
beAnonymous;
getRepository: self userName project: self projectName ]
on: LGitNoCredentialsProvided
do: [ ^ nil ]
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ newRepository
(githubRepository at: #fork)
ifTrue: [ | parent remote |
parent := githubRepository at: #parent.
remote := IceGitRemote name: ((parent at: #owner) at: #login) url: (parent at: #'ssh_url').
remote := IceGitRemote name: ((parent at: #owner) at: #login) url: (parent at: self selectedProtocol githubRequestUrlKey).
newRepository addRemote: remote.
remote fetch. ] ].
^ newRepository
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
*Iceberg-Plugin-GitHub
githubRequestUrlKey
"Return the key used in github REST responses to get the URL with the correct protocol"
self subclassResponsibility
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"name" : "IceUrlProtocol"
}

0 comments on commit 2d16997

Please sign in to comment.