-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1035 from pharo-vcs/859-set-upstream
859-set-upstream
- Loading branch information
Showing
6 changed files
with
68 additions
and
42 deletions.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
Iceberg-Libgit.package/IceGitLocalBranch.class/instance/basicPushTo..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,26 @@ | ||
private-pushing | ||
basicPushTo: aRemote | ||
| gitRemote | | ||
|
||
gitRemote := (LGitRemote of: self repositoryHandle named: aRemote name) lookup. | ||
[ | ||
| pushProgress | | ||
pushProgress := IcePushTransferProgress new. | ||
"Push branch" | ||
self | ||
pushBranchToRemote: aRemote | ||
gitRemote: gitRemote | ||
progress: pushProgress. | ||
"Push tags" | ||
self | ||
pushTagsToRemote: aRemote | ||
gitRemote: gitRemote | ||
progress: pushProgress. | ||
|
||
"Verify we have an stream" | ||
self setUpstreamIfMissing: aRemote ] | ||
on: LGit_GIT_ENONFASTFORWARD | ||
do: [ :e | | ||
e resignalAs: (IceRemoteDesynchronized new | ||
remote: aRemote; | ||
yourself) ] |
13 changes: 13 additions & 0 deletions
13
...Libgit.package/IceGitLocalBranch.class/instance/pushBranchToRemote.gitRemote.progress..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 @@ | ||
private-pushing | ||
pushBranchToRemote: aRemote gitRemote: gitRemote progress: pushProgress | ||
|
||
gitRemote | ||
pushWithRefSpec: (LGitRefSpec new | ||
source: self fullname; | ||
destination: self fullname; | ||
yourself) | ||
pushOptions: (LGitPushOptions defaults | ||
callbacks: ((LGitRemoteCallbacks withProvider: (IceCredentialsProvider defaultForRemote: aRemote)) | ||
pushTransferProgress: pushProgress; | ||
yourself); | ||
yourself) |
13 changes: 13 additions & 0 deletions
13
...g-Libgit.package/IceGitLocalBranch.class/instance/pushTag.toRemote.gitRemote.progress..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 @@ | ||
private-pushing | ||
pushTag: tag toRemote: aRemote gitRemote: gitRemote progress: pushProgress | ||
|
||
gitRemote | ||
pushWithRefSpec: (LGitRefSpec new | ||
source: 'refs/tags/' , tag name; | ||
destination: 'refs/tags/' , tag name; | ||
yourself) | ||
pushOptions: (LGitPushOptions defaults | ||
callbacks: ((LGitRemoteCallbacks withProvider: (IceCredentialsProvider defaultForRemote: aRemote)) | ||
pushTransferProgress: pushProgress; | ||
yourself); | ||
yourself) |
9 changes: 9 additions & 0 deletions
9
...g-Libgit.package/IceGitLocalBranch.class/instance/pushTagsToRemote.gitRemote.progress..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 @@ | ||
private-pushing | ||
pushTagsToRemote: aRemote gitRemote: gitRemote progress: pushProgress | ||
|
||
self tags do: [ :tag | | ||
self | ||
pushTag: tag | ||
toRemote: aRemote | ||
gitRemote: gitRemote | ||
progress: pushProgress ] |
44 changes: 2 additions & 42 deletions
44
Iceberg-Libgit.package/IceGitLocalBranch.class/instance/pushTo..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,45 +1,5 @@ | ||
API-remotes | ||
pushTo: aRemote | ||
|
||
repository | ||
handleLibgitError: [ | gitRemote | | ||
gitRemote := (LGitRemote of: self repositoryHandle named: aRemote name) lookup. | ||
[ | ||
| pushProgress | | ||
pushProgress := IcePushTransferProgress new. | ||
gitRemote | ||
pushWithRefSpec: | ||
(LGitRefSpec new | ||
source: self fullname; | ||
destination: self fullname; | ||
yourself) | ||
pushOptions: | ||
(LGitPushOptions defaults | ||
callbacks: ((LGitRemoteCallbacks withProvider: (IceCredentialsProvider defaultForRemote: aRemote)) | ||
pushTransferProgress: pushProgress; | ||
yourself ); | ||
yourself). | ||
|
||
"Push tags!" | ||
self tags | ||
do: [ :tag | | ||
| tagProgress | | ||
gitRemote | ||
pushWithRefSpec: | ||
(LGitRefSpec new | ||
source: 'refs/tags/' , tag name; | ||
destination: 'refs/tags/' , tag name; | ||
yourself) | ||
pushOptions: | ||
(LGitPushOptions defaults | ||
callbacks: ((LGitRemoteCallbacks withProvider: (IceCredentialsProvider defaultForRemote: aRemote)) | ||
pushTransferProgress: pushProgress; | ||
yourself); | ||
yourself) ] ] | ||
on: LGit_GIT_ENONFASTFORWARD | ||
do: [ :e | | ||
e | ||
resignalAs: | ||
(IceRemoteDesynchronized new | ||
remote: aRemote; | ||
yourself) ] ] | ||
repository handleLibgitError: [ | ||
self basicPushTo: aRemote ] |
5 changes: 5 additions & 0 deletions
5
Iceberg-Libgit.package/IceGitLocalBranch.class/instance/setUpstreamIfMissing..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 @@ | ||
private-pushing | ||
setUpstreamIfMissing: aRemote | ||
|
||
self hasUpstream ifTrue: [ ^ self ]. | ||
self setUpstream: (aRemote remoteBranchNamed: self gitRef) |