diff options
author | Edward Thomson <ethomson@edwardthomson.com> | 2018-12-27 13:47:34 -0600 |
---|---|---|
committer | Edward Thomson <ethomson@edwardthomson.com> | 2019-01-22 22:30:35 +0000 |
commit | f673e232afe22eb865cdc915e55a2df6493f0fbb (patch) | |
tree | e79e3e6fb1e1d78367679aea75e66c8141b4daa8 /src/transports/local.c | |
parent | 647dfdb42d06514a85c1499f1be88a32b8a4c24b (diff) | |
download | libgit2-f673e232afe22eb865cdc915e55a2df6493f0fbb.tar.gz |
git_error: use new names in internal APIs and usage
Move to the `git_error` name in the internal API for error-related
functions.
Diffstat (limited to 'src/transports/local.c')
-rw-r--r-- | src/transports/local.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/transports/local.c b/src/transports/local.c index b8cc950ff..b544491ef 100644 --- a/src/transports/local.c +++ b/src/transports/local.c @@ -83,7 +83,7 @@ static int add_ref(transport_local *t, const char *name) if (!strcmp(name, GIT_HEAD_FILE) && error == GIT_ENOTFOUND) { /* This is actually okay. Empty repos often have a HEAD that * points to a nonexistent "refs/heads/master". */ - giterr_clear(); + git_error_clear(); return 0; } return error; @@ -93,16 +93,16 @@ static int add_ref(transport_local *t, const char *name) git_reference_free(resolved); head = git__calloc(1, sizeof(git_remote_head)); - GITERR_CHECK_ALLOC(head); + GIT_ERROR_CHECK_ALLOC(head); head->name = git__strdup(name); - GITERR_CHECK_ALLOC(head->name); + GIT_ERROR_CHECK_ALLOC(head->name); git_oid_cpy(&head->oid, &obj_id); if (git_reference_type(ref) == GIT_REFERENCE_SYMBOLIC) { head->symref_target = git__strdup(git_reference_symbolic_target(ref)); - GITERR_CHECK_ALLOC(head->symref_target); + GIT_ERROR_CHECK_ALLOC(head->symref_target); } git_reference_free(ref); @@ -130,7 +130,7 @@ static int add_ref(transport_local *t, const char *name) /* And if it's a tag, peel it, and add it to the list */ head = git__calloc(1, sizeof(git_remote_head)); - GITERR_CHECK_ALLOC(head); + GIT_ERROR_CHECK_ALLOC(head); if (git_buf_join(&buf, 0, name, peeled) < 0) { free_head(head); @@ -222,7 +222,7 @@ static int local_connect( free_heads(&t->refs); t->url = git__strdup(url); - GITERR_CHECK_ALLOC(t->url); + GIT_ERROR_CHECK_ALLOC(t->url); t->direction = direction; t->flags = flags; @@ -255,7 +255,7 @@ static int local_ls(const git_remote_head ***out, size_t *size, git_transport *t transport_local *t = (transport_local *)transport; if (!t->have_refs) { - giterr_set(GITERR_NET, "the transport has not yet loaded the refs"); + git_error_set(GIT_ERROR_NET, "the transport has not yet loaded the refs"); return -1; } @@ -288,7 +288,7 @@ static int local_negotiate_fetch( else if (error != GIT_ENOTFOUND) return error; else - giterr_clear(); + git_error_clear(); git_object_free(obj); } @@ -374,7 +374,7 @@ static int local_push( but we forbid all pushes just in case */ if (!remote_repo->is_bare) { error = GIT_EBAREREPO; - giterr_set(GITERR_INVALID, "local push doesn't (yet) support pushing to non-bare repos."); + git_error_set(GIT_ERROR_INVALID, "local push doesn't (yet) support pushing to non-bare repos."); goto on_error; } @@ -418,7 +418,7 @@ static int local_push( status->msg = git__strdup("Remote branch not found to delete"); break; default: - last = giterr_last(); + last = git_error_last(); if (last && last->message) status->msg = git__strdup(last->message); @@ -520,8 +520,8 @@ static int foreach_reference_cb(git_reference *reference, void *payload) error = git_revwalk_hide(walk, git_reference_target(reference)); /* The reference is in the local repository, so the target may not * exist on the remote. It also may not be a commit. */ - if (error == GIT_ENOTFOUND || error == GITERR_INVALID) { - giterr_clear(); + if (error == GIT_ENOTFOUND || error == GIT_ERROR_INVALID) { + git_error_clear(); error = 0; } @@ -718,7 +718,7 @@ int git_transport_local(git_transport **out, git_remote *owner, void *param) GIT_UNUSED(param); t = git__calloc(1, sizeof(transport_local)); - GITERR_CHECK_ALLOC(t); + GIT_ERROR_CHECK_ALLOC(t); t->parent.version = GIT_TRANSPORT_VERSION; t->parent.set_callbacks = local_set_callbacks; |