diff options
| author | Ben Straub <bs@github.com> | 2012-11-27 13:15:43 -0800 |
|---|---|---|
| committer | Ben Straub <bs@github.com> | 2012-11-27 13:19:49 -0800 |
| commit | df705148ecc0d0a4c78f7a3b0903527918e38149 (patch) | |
| tree | 89d5d71d0b2fc45182a884e4aa64a7b4338d7f7d /src | |
| parent | 74f9132212a1c634c45241852dbd8564427e964b (diff) | |
| download | libgit2-df705148ecc0d0a4c78f7a3b0903527918e38149.tar.gz | |
API updates for remote.h
Includes typedef for git_direction, and renames for
GIT_DIR_[FETCH|PUSH] to GIT_DIRECTION_(\1).
Diffstat (limited to 'src')
| -rw-r--r-- | src/clone.c | 2 | ||||
| -rw-r--r-- | src/remote.c | 32 | ||||
| -rw-r--r-- | src/transports/smart.c | 4 |
3 files changed, 19 insertions, 19 deletions
diff --git a/src/clone.c b/src/clone.c index c90d85466..7d49b398b 100644 --- a/src/clone.c +++ b/src/clone.c @@ -278,7 +278,7 @@ static int setup_remotes_and_fetch( git_remote_set_update_fetchhead(origin, 0); /* Connect and download everything */ - if (!git_remote_connect(origin, GIT_DIR_FETCH)) { + if (!git_remote_connect(origin, GIT_DIRECTION_FETCH)) { if (!git_remote_download(origin, progress_cb, progress_payload)) { /* Create "origin/foo" branches for all remote branches */ if (!git_remote_update_tips(origin)) { diff --git a/src/remote.c b/src/remote.c index 5035588a3..2f7c89471 100644 --- a/src/remote.c +++ b/src/remote.c @@ -252,7 +252,7 @@ static int update_config_refspec( &name, "remote.%s.%s", remote_name, - git_direction == GIT_DIR_FETCH ? "fetch" : "push") < 0) + git_direction == GIT_DIRECTION_FETCH ? "fetch" : "push") < 0) goto cleanup; if (git_refspec__serialize(&value, refspec) < 0) @@ -318,14 +318,14 @@ int git_remote_save(const git_remote *remote) config, remote->name, &remote->fetch, - GIT_DIR_FETCH) < 0) + GIT_DIRECTION_FETCH) < 0) goto on_error; if (update_config_refspec( config, remote->name, &remote->push, - GIT_DIR_PUSH) < 0) + GIT_DIRECTION_PUSH) < 0) goto on_error; /* @@ -369,13 +369,13 @@ on_error: return -1; } -const char *git_remote_name(git_remote *remote) +const char *git_remote_name(const git_remote *remote) { assert(remote); return remote->name; } -const char *git_remote_url(git_remote *remote) +const char *git_remote_url(const git_remote *remote) { assert(remote); return remote->url; @@ -393,7 +393,7 @@ int git_remote_set_url(git_remote *remote, const char* url) return 0; } -const char *git_remote_pushurl(git_remote *remote) +const char *git_remote_pushurl(const git_remote *remote) { assert(remote); return remote->pushurl; @@ -429,7 +429,7 @@ int git_remote_set_fetchspec(git_remote *remote, const char *spec) return 0; } -const git_refspec *git_remote_fetchspec(git_remote *remote) +const git_refspec *git_remote_fetchspec(const git_remote *remote) { assert(remote); return &remote->fetch; @@ -451,7 +451,7 @@ int git_remote_set_pushspec(git_remote *remote, const char *spec) return 0; } -const git_refspec *git_remote_pushspec(git_remote *remote) +const git_refspec *git_remote_pushspec(const git_remote *remote) { assert(remote); return &remote->push; @@ -461,18 +461,18 @@ const char* git_remote__urlfordirection(git_remote *remote, int direction) { assert(remote); - if (direction == GIT_DIR_FETCH) { + if (direction == GIT_DIRECTION_FETCH) { return remote->url; } - if (direction == GIT_DIR_PUSH) { + if (direction == GIT_DIRECTION_PUSH) { return remote->pushurl ? remote->pushurl : remote->url; } return NULL; } -int git_remote_connect(git_remote *remote, int direction) +int git_remote_connect(git_remote *remote, git_direction direction) { git_transport *t; const char *url; @@ -492,7 +492,7 @@ int git_remote_connect(git_remote *remote, int direction) return -1; if (t->set_callbacks && - t->set_callbacks(t, remote->callbacks.progress, NULL, remote->callbacks.data) < 0) + t->set_callbacks(t, remote->callbacks.progress, NULL, remote->callbacks.payload) < 0) goto on_error; if (!remote->check_cert) @@ -753,7 +753,7 @@ int git_remote_update_tips(git_remote *remote) git_reference_free(ref); if (remote->callbacks.update_tips != NULL) { - if (remote->callbacks.update_tips(refname.ptr, &old, &head->oid, remote->callbacks.data) < 0) + if (remote->callbacks.update_tips(refname.ptr, &old, &head->oid, remote->callbacks.payload) < 0) goto on_error; } } @@ -936,7 +936,7 @@ void git_remote_set_callbacks(git_remote *remote, git_remote_callbacks *callback remote->transport->set_callbacks(remote->transport, remote->callbacks.progress, NULL, - remote->callbacks.data); + remote->callbacks.payload); } void git_remote_set_cred_acquire_cb( @@ -1194,7 +1194,7 @@ static int rename_fetch_refspecs( if (git_repository_config__weakptr(&config, remote->repo) < 0) goto cleanup; - error = update_config_refspec(config, new_name, &remote->fetch, GIT_DIR_FETCH); + error = update_config_refspec(config, new_name, &remote->fetch, GIT_DIRECTION_FETCH); cleanup: git_buf_free(&serialized); @@ -1205,7 +1205,7 @@ cleanup: int git_remote_rename( git_remote *remote, const char *new_name, - int (*callback)(const char *problematic_refspec, void *payload), + git_remote_rename_problem_cb callback, void *payload) { int error; diff --git a/src/transports/smart.c b/src/transports/smart.c index 195ea285c..e8dbbef5c 100644 --- a/src/transports/smart.c +++ b/src/transports/smart.c @@ -73,7 +73,7 @@ static int git_smart__connect( t->flags = flags; t->cred_acquire_cb = cred_acquire_cb; - if (GIT_DIR_FETCH == direction) + if (GIT_DIRECTION_FETCH == direction) { if ((error = t->wrapped->action(&stream, t->wrapped, t->url, GIT_SERVICE_UPLOADPACK_LS)) < 0) return error; @@ -159,7 +159,7 @@ int git_smart__negotiation_step(git_transport *transport, void *data, size_t len if (t->rpc) git_smart__reset_stream(t); - if (GIT_DIR_FETCH == t->direction) { + if (GIT_DIRECTION_FETCH == t->direction) { if ((error = t->wrapped->action(&stream, t->wrapped, t->url, GIT_SERVICE_UPLOADPACK)) < 0) return error; |
