Skip to content

Commit

Permalink
Merge pull request #22 from tesonep/progressInOperations
Browse files Browse the repository at this point in the history
Adding progress callback support
  • Loading branch information
tesonep authored Jun 26, 2018
2 parents cf133b4 + b9b9aa2 commit caf4ecb
Show file tree
Hide file tree
Showing 13 changed files with 54 additions and 16 deletions.
3 changes: 3 additions & 0 deletions .project
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
'srcDirectory' : ''
}
3 changes: 3 additions & 0 deletions .properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
#format : #filetree
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
accessing
progressCallback: anIceGitCheckoutProgress

progressCallback := anIceGitCheckoutProgress.
self prim_progress_cb: anIceGitCheckoutProgress
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@
"OFFSET_PRIM_THEIR_LABEL",
"OFFSET_PRIM_VERSION"
],
"instvars" : [ ],
"instvars" : [
"progressCallback"
],
"name" : "LGitCheckoutOptions",
"type" : "normal"
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
accessing
fnSpec
^#(void (String path, size_t completed_steps, size_t total_steps, void *payload))
^#(void (String* path, size_t completed_steps, size_t total_steps, void* payload))
2 changes: 1 addition & 1 deletion LibGit-Core.package/LGitIndex.class/instance/addAll..st
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ addAll: pathSpecs
index_add_all: self
pathspec: pathspec
flags: 0
callback: ExternalAddress null
callback: (LGitIndexMatchedPathCallback on: [ :a :b :c | 0 ])
payload: ExternalAddress null ]
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ index_add_all: index pathspec: pathspec flags: flags callback: callback payload:
self,
LGitStringArray *pathspec,
uint flags,
void* callback,
LGitIndexMatchedPathCallback callback,
void *payload))
options: #(optMayGC optCoerceNilToNull)
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
operations
fetchWithCredentials: aCredentialsProvider andProgressCallback: progressCallback

^ self
fetchWithCredentials: aCredentialsProvider
andProgressCallback: progressCallback
refSpec: nil
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
operations
fetchWithCredentials: aCredentialsProvider andProgressCallback: progressCallback refSpec: aRefSpec
| refSpecs callbacks |
self isReady ifFalse: [ self create ].
refSpecs := aRefSpec ifNotNil: [LGitStringArray withAll: { aRefSpec asString }].
self withReturnHandlerDo: [

callbacks := LGitRemoteCallbacks withProvider: aCredentialsProvider.
progressCallback ifNotNil: [callbacks transferProgress: progressCallback].

self
remote_fetch: self
refspecs: refSpecs
opts: (LGitFetchOptions defaults
callbacks:callbacks;
yourself)
reflog_message: nil ]
Original file line number Diff line number Diff line change
@@ -1,13 +1,4 @@
operations
fetchWithCredentials: aCredentialsProvider refSpec: aRefSpec
| refSpecs |
self isReady ifFalse: [ self create ].
refSpecs := aRefSpec ifNotNil: [LGitStringArray withAll: { aRefSpec asString }].
self withReturnHandlerDo: [
self
remote_fetch: self
refspecs: refSpecs
opts: (LGitFetchOptions defaults
callbacks:(LGitRemoteCallbacks withProvider: aCredentialsProvider);
yourself)
reflog_message: nil ]

^ self fetchWithCredentials: aCredentialsProvider andProgressCallback: nil refSpec: aRefSpec
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
pushTransferProgress: aCallback
pushTransferProgress := aCallback.
self prim_push_transfer_progress: aCallback
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
transferProgress: aCallback
transferProgressCallback := aCallback.
self prim_transfer_progress: aCallback
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@
],
"instvars" : [
"credentialsCallback",
"certificateCheckCallback"
"certificateCheckCallback",
"transferProgressCallback",
"pushTransferProgress"
],
"name" : "LGitRemoteCallbacks",
"type" : "normal"
Expand Down

0 comments on commit caf4ecb

Please sign in to comment.