summaryrefslogtreecommitdiff
path: root/src/describe.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/describe.c')
-rw-r--r--src/describe.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/describe.c b/src/describe.c
index cf2c72841..7e57d64e7 100644
--- a/src/describe.c
+++ b/src/describe.c
@@ -108,7 +108,7 @@ static int add_to_known_names(
if (replace_name(&tag, repo, e, prio, sha1)) {
if (!found) {
e = git__malloc(sizeof(struct commit_name));
- GITERR_CHECK_ALLOC(e);
+ GIT_ERROR_CHECK_ALLOC(e);
e->path = NULL;
e->tag = NULL;
@@ -191,7 +191,7 @@ static int commit_name_dup(struct commit_name **out, struct commit_name *in)
struct commit_name *name;
name = git__malloc(sizeof(struct commit_name));
- GITERR_CHECK_ALLOC(name);
+ GIT_ERROR_CHECK_ALLOC(name);
memcpy(name, in, sizeof(struct commit_name));
name->tag = NULL;
@@ -201,7 +201,7 @@ static int commit_name_dup(struct commit_name **out, struct commit_name *in)
return -1;
name->path = git__strdup(in->path);
- GITERR_CHECK_ALLOC(name->path);
+ GIT_ERROR_CHECK_ALLOC(name->path);
*out = name;
return 0;
@@ -267,7 +267,7 @@ static int possible_tag_dup(struct possible_tag **out, struct possible_tag *in)
int error;
tag = git__malloc(sizeof(struct possible_tag));
- GITERR_CHECK_ALLOC(tag);
+ GIT_ERROR_CHECK_ALLOC(tag);
memcpy(tag, in, sizeof(struct possible_tag));
tag->name = NULL;
@@ -335,14 +335,14 @@ static int display_name(git_buf *buf, git_repository *repo, struct commit_name *
{
if (n->prio == 2 && !n->tag) {
if (git_tag_lookup(&n->tag, repo, &n->sha1) < 0) {
- giterr_set(GITERR_TAG, "annotated tag '%s' not available", n->path);
+ git_error_set(GIT_ERROR_TAG, "annotated tag '%s' not available", n->path);
return -1;
}
}
if (n->tag && !n->name_checked) {
if (!git_tag_name(n->tag)) {
- giterr_set(GITERR_TAG, "annotated tag '%s' has no embedded name", n->path);
+ git_error_set(GIT_ERROR_TAG, "annotated tag '%s' has no embedded name", n->path);
return -1;
}
@@ -425,7 +425,7 @@ static int describe_not_found(const git_oid *oid, const char *message_format) {
char oid_str[GIT_OID_HEXSZ + 1];
git_oid_tostr(oid_str, sizeof(oid_str), oid);
- giterr_set(GITERR_DESCRIBE, message_format, oid_str);
+ git_error_set(GIT_ERROR_DESCRIBE, message_format, oid_str);
return GIT_ENOTFOUND;
}
@@ -504,7 +504,7 @@ static int describe(
unannotated_cnt++;
} else if (match_cnt < data->opts->max_candidates_tags) {
struct possible_tag *t = git__malloc(sizeof(struct commit_name));
- GITERR_CHECK_ALLOC(t);
+ GIT_ERROR_CHECK_ALLOC(t);
if ((error = git_vector_insert(&all_matches, t)) < 0)
goto cleanup;
@@ -667,7 +667,7 @@ int git_describe_commit(
assert(committish);
data.result = git__calloc(1, sizeof(git_describe_result));
- GITERR_CHECK_ALLOC(data.result);
+ GIT_ERROR_CHECK_ALLOC(data.result);
data.result->repo = git_object_owner(committish);
data.repo = git_object_owner(committish);
@@ -675,14 +675,14 @@ int git_describe_commit(
if ((error = normalize_options(&normalized, opts)) < 0)
return error;
- GITERR_CHECK_VERSION(
+ GIT_ERROR_CHECK_VERSION(
&normalized,
GIT_DESCRIBE_OPTIONS_VERSION,
"git_describe_options");
data.opts = &normalized;
data.names = git_oidmap_alloc();
- GITERR_CHECK_ALLOC(data.names);
+ GIT_ERROR_CHECK_ALLOC(data.names);
/** TODO: contains to be implemented */
@@ -695,7 +695,7 @@ int git_describe_commit(
goto cleanup;
if (git_oidmap_size(data.names) == 0 && !opts->show_commit_oid_as_fallback) {
- giterr_set(GITERR_DESCRIBE, "cannot describe - "
+ git_error_set(GIT_ERROR_DESCRIBE, "cannot describe - "
"no reference found, cannot describe anything.");
error = -1;
goto cleanup;
@@ -786,14 +786,14 @@ int git_describe_format(git_buf *out, const git_describe_result *result, const g
assert(out && result);
- GITERR_CHECK_VERSION(given, GIT_DESCRIBE_FORMAT_OPTIONS_VERSION, "git_describe_format_options");
+ GIT_ERROR_CHECK_VERSION(given, GIT_DESCRIBE_FORMAT_OPTIONS_VERSION, "git_describe_format_options");
normalize_format_options(&opts, given);
git_buf_sanitize(out);
if (opts.always_use_long_format && opts.abbreviated_size == 0) {
- giterr_set(GITERR_DESCRIBE, "cannot describe - "
+ git_error_set(GIT_ERROR_DESCRIBE, "cannot describe - "
"'always_use_long_format' is incompatible with a zero"
"'abbreviated_size'");
return -1;