diff options
author | brian m. carlson <sandals@crustytoothpaste.net> | 2017-10-15 22:07:11 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-10-16 11:05:52 +0900 |
commit | 99afe91a6c3a37b7bb32c824f19b1b51712fe6f3 (patch) | |
tree | 87613256629ddd8f96d6dfab7089330a04f0353a /refs.c | |
parent | ac2ed0d7d51e5c0b402797ecf01f38e9bfc82e0e (diff) | |
download | git-99afe91a6c3a37b7bb32c824f19b1b51712fe6f3.tar.gz |
refs: convert read_raw_ref backends to struct object_id
Convert the unsigned char * parameter to struct object_id * for
files_read_raw_ref and packed_read_raw_ref. Update the documentation.
Switch from using get_sha1_hex and a hard-coded 40 to using
parse_oid_hex.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'refs.c')
-rw-r--r-- | refs.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -1382,10 +1382,10 @@ int for_each_rawref(each_ref_fn fn, void *cb_data) } int refs_read_raw_ref(struct ref_store *ref_store, - const char *refname, unsigned char *sha1, + const char *refname, struct object_id *oid, struct strbuf *referent, unsigned int *type) { - return ref_store->be->read_raw_ref(ref_store, refname, sha1, referent, type); + return ref_store->be->read_raw_ref(ref_store, refname, oid, referent, type); } /* This function needs to return a meaningful errno on failure */ @@ -1428,7 +1428,7 @@ const char *refs_resolve_ref_unsafe(struct ref_store *refs, unsigned int read_flags = 0; if (refs_read_raw_ref(refs, refname, - oid->hash, &sb_refname, &read_flags)) { + oid, &sb_refname, &read_flags)) { *flags |= read_flags; /* In reading mode, refs must eventually resolve */ @@ -1879,7 +1879,7 @@ int refs_verify_refname_available(struct ref_store *refs, if (skip && string_list_has_string(skip, dirname.buf)) continue; - if (!refs_read_raw_ref(refs, dirname.buf, oid.hash, &referent, &type)) { + if (!refs_read_raw_ref(refs, dirname.buf, &oid, &referent, &type)) { strbuf_addf(err, "'%s' exists; cannot create '%s'", dirname.buf, refname); goto cleanup; |