diff options
author | Vicent Marti <tanoku@gmail.com> | 2011-06-16 02:36:21 +0200 |
---|---|---|
committer | Vicent Marti <tanoku@gmail.com> | 2011-06-16 02:36:21 +0200 |
commit | fa48608ec30758dbf6d0d26d3c4f8efba8efe8e9 (patch) | |
tree | 31e3cc7bedaa6c4d3a8b8d37903991ed811eb02d /src | |
parent | 43521d0688c744e98f07f19dd0b15e6b2c763693 (diff) | |
download | libgit2-fa48608ec30758dbf6d0d26d3c4f8efba8efe8e9.tar.gz |
oid: Rename methods
Yeah. Finally. Fuck the old names, this ain't POSIX
and they don't make any sense at all.
Diffstat (limited to 'src')
-rw-r--r-- | src/index.c | 6 | ||||
-rw-r--r-- | src/odb_loose.c | 2 | ||||
-rw-r--r-- | src/odb_pack.c | 4 | ||||
-rw-r--r-- | src/oid.c | 6 | ||||
-rw-r--r-- | src/refs.c | 6 | ||||
-rw-r--r-- | src/revwalk.c | 2 | ||||
-rw-r--r-- | src/tree.c | 2 |
7 files changed, 14 insertions, 14 deletions
diff --git a/src/index.c b/src/index.c index 08e24906c..23fd52e09 100644 --- a/src/index.c +++ b/src/index.c @@ -582,7 +582,7 @@ static int read_tree_internal(git_index_tree **out, goto cleanup; } - git_oid_mkraw(&tree->oid, (const unsigned char *)buffer); + git_oid_fromraw(&tree->oid, (const unsigned char *)buffer); buffer += GIT_OID_RAWSZ; /* Parse children: */ @@ -670,7 +670,7 @@ static int read_unmerged(git_index *index, const char *buffer, size_t size) continue; if (size < 20) return git__throw(GIT_ERROR, "Failed to read unmerged entries"); - git_oid_mkraw(&lost->oid[i], (unsigned char *) buffer); + git_oid_fromraw(&lost->oid[i], (unsigned char *) buffer); size -= 20; buffer += 20; } @@ -867,7 +867,7 @@ static int parse_index(git_index *index, const char *buffer, size_t buffer_size) return git__throw(GIT_EOBJCORRUPTED, "Failed to parse index. Buffer size does not match index footer size"); /* 160-bit SHA-1 over the content of the index file before this checksum. */ - git_oid_mkraw(&checksum_expected, (const unsigned char *)buffer); + git_oid_fromraw(&checksum_expected, (const unsigned char *)buffer); if (git_oid_cmp(&checksum_calculated, &checksum_expected) != 0) return git__throw(GIT_EOBJCORRUPTED, "Failed to parse index. Calculated checksum does not match expected checksum"); diff --git a/src/odb_loose.c b/src/odb_loose.c index 9564ef05b..006ba9cc8 100644 --- a/src/odb_loose.c +++ b/src/odb_loose.c @@ -546,7 +546,7 @@ static int locate_object_short_oid(char *object_location, git_oid *res_oid, loos } /* Convert obtained hex formatted oid to raw */ - error = git_oid_mkstr(res_oid, (char *)state.res_oid); + error = git_oid_fromstr(res_oid, (char *)state.res_oid); if (error) { return git__rethrow(error, "Failed to locate object from short oid"); } diff --git a/src/odb_pack.c b/src/odb_pack.c index 29ceb02dc..d02338d62 100644 --- a/src/odb_pack.c +++ b/src/odb_pack.c @@ -856,7 +856,7 @@ static int packfile_check(struct pack_file **pack_out, const char *path) /* see if we can parse the sha1 oid in the packfile name */ if (path_len < 40 || - git_oid_mkstr(&p->sha1, path + path_len - GIT_OID_HEXSZ) < GIT_SUCCESS) + git_oid_fromstr(&p->sha1, path + path_len - GIT_OID_HEXSZ) < GIT_SUCCESS) memset(&p->sha1, 0x0, GIT_OID_RAWSZ); *pack_out = p; @@ -1032,7 +1032,7 @@ static int pack_entry_find_offset( return git__throw(GIT_EAMBIGUOUSOIDPREFIX, "Failed to find offset for pack entry. Ambiguous sha1 prefix within pack"); } else { *offset_out = nth_packed_object_offset(p, pos); - git_oid_mkraw(found_oid, current); + git_oid_fromraw(found_oid, current); #ifdef INDEX_DEBUG_LOOKUP unsigned char hex_sha1[GIT_OID_HEXSZ + 1]; @@ -49,7 +49,7 @@ static signed char from_hex[] = { }; static char to_hex[] = "0123456789abcdef"; -int git_oid_mkstr(git_oid *out, const char *str) +int git_oid_fromstr(git_oid *out, const char *str) { size_t p; for (p = 0; p < sizeof(out->id); p++, str += 2) { @@ -135,7 +135,7 @@ int git__parse_oid(git_oid *oid, const char **buffer_out, if (buffer[header_len + sha_len] != '\n') return git__throw(GIT_EOBJCORRUPTED, "Failed to parse OID. Buffer not terminated correctly"); - if (git_oid_mkstr(oid, buffer + header_len) < GIT_SUCCESS) + if (git_oid_fromstr(oid, buffer + header_len) < GIT_SUCCESS) return git__throw(GIT_EOBJCORRUPTED, "Failed to parse OID. Failed to generate sha1"); *buffer_out = buffer + (header_len + sha_len + 1); @@ -157,7 +157,7 @@ int git__write_oid(git_odb_stream *stream, const char *header, const git_oid *oi return GIT_SUCCESS; } -void git_oid_mkraw(git_oid *out, const unsigned char *raw) +void git_oid_fromraw(git_oid *out, const unsigned char *raw) { memcpy(out->id, raw, sizeof(out->id)); } diff --git a/src/refs.c b/src/refs.c index 2aedb852a..e74eca2df 100644 --- a/src/refs.c +++ b/src/refs.c @@ -272,7 +272,7 @@ static int loose_parse_oid(git_reference *ref, gitfo_buf *file_content) return git__throw(GIT_EOBJCORRUPTED, "Failed to parse loose reference. Reference too short"); - if ((error = git_oid_mkstr(&ref_oid->oid, buffer)) < GIT_SUCCESS) + if ((error = git_oid_fromstr(&ref_oid->oid, buffer)) < GIT_SUCCESS) return git__rethrow(GIT_EOBJCORRUPTED, "Failed to parse loose reference."); buffer = buffer + GIT_OID_HEXSZ; @@ -447,7 +447,7 @@ static int packed_parse_peel( return git__throw(GIT_EPACKEDREFSCORRUPTED, "Failed to parse packed reference. Buffer too small"); /* Is this a valid object id? */ - if (git_oid_mkstr(&tag_ref->peel_target, buffer) < GIT_SUCCESS) + if (git_oid_fromstr(&tag_ref->peel_target, buffer) < GIT_SUCCESS) return git__throw(GIT_EPACKEDREFSCORRUPTED, "Failed to parse packed reference. Not a valid object ID"); buffer = buffer + GIT_OID_HEXSZ; @@ -487,7 +487,7 @@ static int packed_parse_oid( } /* Is this a valid object id? */ - if ((error = git_oid_mkstr(&id, buffer)) < GIT_SUCCESS) + if ((error = git_oid_fromstr(&id, buffer)) < GIT_SUCCESS) goto cleanup; refname_end = memchr(refname_begin, '\n', buffer_end - refname_begin); diff --git a/src/revwalk.c b/src/revwalk.c index b64b0e2c0..515279619 100644 --- a/src/revwalk.c +++ b/src/revwalk.c @@ -209,7 +209,7 @@ static int commit_quick_parse(git_revwalk *walk, commit_object *commit, git_rawo for (i = 0; i < parents; ++i) { git_oid oid; - if (git_oid_mkstr(&oid, (char *)buffer + STRLEN("parent ")) < GIT_SUCCESS) + if (git_oid_fromstr(&oid, (char *)buffer + STRLEN("parent ")) < GIT_SUCCESS) return git__throw(GIT_EOBJCORRUPTED, "Failed to parse commit. Parent object is corrupted"); commit->parents[i] = commit_lookup(walk, &oid); diff --git a/src/tree.c b/src/tree.c index fabcfd80c..2c10ab8a4 100644 --- a/src/tree.c +++ b/src/tree.c @@ -183,7 +183,7 @@ static int tree_parse_buffer(git_tree *tree, const char *buffer, const char *buf buffer++; - git_oid_mkraw(&entry->oid, (const unsigned char *)buffer); + git_oid_fromraw(&entry->oid, (const unsigned char *)buffer); buffer += GIT_OID_RAWSZ; } |