diff options
author | Yuang Li <yuangli88@hotmail.com> | 2022-07-29 01:32:40 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-29 01:32:40 +0100 |
commit | 09acf6986513381316c8797c4529323bff8525a5 (patch) | |
tree | 2802cfbafd3e7d94e6a3153848ed0edf3ac1aebc /src/libgit2/fetchhead.c | |
parent | 3d7a609d632d7a16d099897735f41dae248e943b (diff) | |
parent | 7f46bfac14f0502711f8441348fd361175953fd5 (diff) | |
download | libgit2-09acf6986513381316c8797c4529323bff8525a5.tar.gz |
Merge branch 'mw_dev' into shallow-clone-local
Diffstat (limited to 'src/libgit2/fetchhead.c')
-rw-r--r-- | src/libgit2/fetchhead.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libgit2/fetchhead.c b/src/libgit2/fetchhead.c index 6511124ef..0ebfe5c43 100644 --- a/src/libgit2/fetchhead.c +++ b/src/libgit2/fetchhead.c @@ -105,7 +105,7 @@ static int fetchhead_ref_write( git_filebuf *file, git_fetchhead_ref *fetchhead_ref) { - char oid[GIT_OID_HEXSZ + 1]; + char oid[GIT_OID_SHA1_HEXSIZE + 1]; const char *type, *name; int head = 0; @@ -113,7 +113,7 @@ static int fetchhead_ref_write( GIT_ASSERT_ARG(fetchhead_ref); git_oid_fmt(oid, &fetchhead_ref->oid); - oid[GIT_OID_HEXSZ] = '\0'; + oid[GIT_OID_SHA1_HEXSIZE] = '\0'; if (git__prefixcmp(fetchhead_ref->ref_name, GIT_REFS_HEADS_DIR) == 0) { type = "branch "; @@ -196,13 +196,13 @@ static int fetchhead_ref_parse( *is_merge = 1; } - if (strlen(oid_str) != GIT_OID_HEXSZ) { + if (strlen(oid_str) != GIT_OID_SHA1_HEXSIZE) { 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) { + if (git_oid__fromstr(oid, oid_str, GIT_OID_SHA1) < 0) { const git_error *oid_err = git_error_last(); const char *err_msg = oid_err ? oid_err->message : "invalid object ID"; |