summaryrefslogtreecommitdiff
path: root/refs
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2017-10-15 22:06:56 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-10-16 02:05:50 (GMT)
commit34c290a6fc8b1f6705d2646d726df2260927da0f (patch)
tree669c6569783ec61850be600dcd1b8496cabbf66d /refs
parent0f2dc722dd01097d1e1c1dac43b2f57924594457 (diff)
downloadgit-34c290a6fc8b1f6705d2646d726df2260927da0f.zip
git-34c290a6fc8b1f6705d2646d726df2260927da0f.tar.gz
git-34c290a6fc8b1f6705d2646d726df2260927da0f.tar.bz2
refs: convert read_ref and read_ref_full to object_id
All but two of the call sites already have parameters using the hash parameter of struct object_id, so convert them to take a pointer to the struct directly. Also convert refs_read_refs_full, the underlying implementation. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'refs')
-rw-r--r--refs/files-backend.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/refs/files-backend.c b/refs/files-backend.c
index 8ab0a7a..9814cbd 100644
--- a/refs/files-backend.c
+++ b/refs/files-backend.c
@@ -782,7 +782,7 @@ static int verify_lock(struct ref_store *ref_store, struct ref_lock *lock,
if (refs_read_ref_full(ref_store, lock->ref_name,
mustexist ? RESOLVE_REF_READING : 0,
- lock->old_oid.hash, NULL)) {
+ &lock->old_oid, NULL)) {
if (old_sha1) {
int save_errno = errno;
strbuf_addf(err, "can't verify ref '%s'", lock->ref_name);
@@ -1297,7 +1297,7 @@ static int files_copy_or_rename_ref(struct ref_store *ref_store,
*/
if (!copy && !refs_read_ref_full(&refs->base, newrefname,
RESOLVE_REF_READING | RESOLVE_REF_NO_RECURSE,
- oid.hash, NULL) &&
+ &oid, NULL) &&
refs_delete_ref(&refs->base, NULL, newrefname,
NULL, REF_NODEREF)) {
if (errno == EISDIR) {
@@ -1721,7 +1721,7 @@ static void update_symref_reflog(struct files_ref_store *refs,
struct object_id new_oid;
if (logmsg &&
!refs_read_ref_full(&refs->base, target,
- RESOLVE_REF_READING, new_oid.hash, NULL) &&
+ RESOLVE_REF_READING, &new_oid, NULL) &&
files_log_ref_write(refs, refname, &lock->old_oid,
&new_oid, logmsg, 0, &err)) {
error("%s", err.buf);
@@ -2010,7 +2010,7 @@ static int files_reflog_iterator_advance(struct ref_iterator *ref_iterator)
if (refs_read_ref_full(iter->ref_store,
diter->relative_path, 0,
- iter->oid.hash, &flags)) {
+ &iter->oid, &flags)) {
error("bad ref for %s", diter->path.buf);
continue;
}
@@ -2347,7 +2347,7 @@ static int lock_ref_for_update(struct files_ref_store *refs,
*/
if (refs_read_ref_full(&refs->base,
referent.buf, 0,
- lock->old_oid.hash, NULL)) {
+ &lock->old_oid, NULL)) {
if (update->flags & REF_HAVE_OLD) {
strbuf_addf(err, "cannot lock ref '%s': "
"error reading reference",