summaryrefslogtreecommitdiff
path: root/src/fetchhead.c
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2018-12-27 13:47:34 -0600
committerEdward Thomson <ethomson@edwardthomson.com>2019-01-22 22:30:35 +0000
commitf673e232afe22eb865cdc915e55a2df6493f0fbb (patch)
treee79e3e6fb1e1d78367679aea75e66c8141b4daa8 /src/fetchhead.c
parent647dfdb42d06514a85c1499f1be88a32b8a4c24b (diff)
downloadlibgit2-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/fetchhead.c')
-rw-r--r--src/fetchhead.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/fetchhead.c b/src/fetchhead.c
index e71021624..bdded029a 100644
--- a/src/fetchhead.c
+++ b/src/fetchhead.c
@@ -50,7 +50,7 @@ int git_fetchhead_ref_create(
*out = NULL;
fetchhead_ref = git__malloc(sizeof(git_fetchhead_ref));
- GITERR_CHECK_ALLOC(fetchhead_ref);
+ GIT_ERROR_CHECK_ALLOC(fetchhead_ref);
memset(fetchhead_ref, 0x0, sizeof(git_fetchhead_ref));
@@ -148,7 +148,7 @@ static int fetchhead_ref_parse(
*remote_url = NULL;
if (!*line) {
- giterr_set(GITERR_FETCHHEAD,
+ git_error_set(GIT_ERROR_FETCHHEAD,
"empty line in FETCH_HEAD line %"PRIuZ, line_num);
return -1;
}
@@ -162,16 +162,16 @@ static int fetchhead_ref_parse(
}
if (strlen(oid_str) != GIT_OID_HEXSZ) {
- giterr_set(GITERR_FETCHHEAD,
+ git_error_set(GIT_ERROR_FETCHHEAD,
"invalid object ID in FETCH_HEAD line %"PRIuZ, line_num);
return -1;
}
if (git_oid_fromstr(oid, oid_str) < 0) {
- const git_error *oid_err = giterr_last();
+ const git_error *oid_err = git_error_last();
const char *err_msg = oid_err ? oid_err->message : "invalid object ID";
- giterr_set(GITERR_FETCHHEAD, "%s in FETCH_HEAD line %"PRIuZ,
+ git_error_set(GIT_ERROR_FETCHHEAD, "%s in FETCH_HEAD line %"PRIuZ,
err_msg, line_num);
return -1;
}
@@ -179,7 +179,7 @@ static int fetchhead_ref_parse(
/* Parse new data from newer git clients */
if (*line) {
if ((is_merge_str = git__strsep(&line, "\t")) == NULL) {
- giterr_set(GITERR_FETCHHEAD,
+ git_error_set(GIT_ERROR_FETCHHEAD,
"invalid description data in FETCH_HEAD line %"PRIuZ, line_num);
return -1;
}
@@ -189,13 +189,13 @@ static int fetchhead_ref_parse(
else if (strcmp(is_merge_str, "not-for-merge") == 0)
*is_merge = 0;
else {
- giterr_set(GITERR_FETCHHEAD,
+ git_error_set(GIT_ERROR_FETCHHEAD,
"invalid for-merge entry in FETCH_HEAD line %"PRIuZ, line_num);
return -1;
}
if ((desc = line) == NULL) {
- giterr_set(GITERR_FETCHHEAD,
+ git_error_set(GIT_ERROR_FETCHHEAD,
"invalid description in FETCH_HEAD line %"PRIuZ, line_num);
return -1;
}
@@ -212,7 +212,7 @@ static int fetchhead_ref_parse(
if (name) {
if ((desc = strstr(name, "' ")) == NULL ||
git__prefixcmp(desc, "' of ") != 0) {
- giterr_set(GITERR_FETCHHEAD,
+ git_error_set(GIT_ERROR_FETCHHEAD,
"invalid description in FETCH_HEAD line %"PRIuZ, line_num);
return -1;
}
@@ -271,13 +271,13 @@ int git_repository_fetchhead_foreach(git_repository *repo,
error = cb(ref_name, remote_url, &oid, is_merge, payload);
if (error) {
- giterr_set_after_callback(error);
+ git_error_set_after_callback(error);
goto done;
}
}
if (*buffer) {
- giterr_set(GITERR_FETCHHEAD, "no EOL at line %"PRIuZ, line_num+1);
+ git_error_set(GIT_ERROR_FETCHHEAD, "no EOL at line %"PRIuZ, line_num+1);
error = -1;
goto done;
}