summaryrefslogtreecommitdiff
path: root/refs
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2017-10-15 22:07:04 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-10-16 02:05:51 (GMT)
commit0155f710b856970dc1dc5261e740f135c67a7b1d (patch)
treef6122e27a1303bab633d2a5137cffdf468e60c57 /refs
parent8eb36d9422a04a30ecc54fd69b4f836eafd10637 (diff)
downloadgit-0155f710b856970dc1dc5261e740f135c67a7b1d.zip
git-0155f710b856970dc1dc5261e740f135c67a7b1d.tar.gz
git-0155f710b856970dc1dc5261e740f135c67a7b1d.tar.bz2
refs: convert reflog_expire parameter to struct object_id
reflog_expire already used struct object_id internally, but it did not take it as a parameter. Adjust the parameter (and the callers) to pass a pointer to struct object_id instead of a pointer to unsigned char. Remove the temporary inserted earlier as it is no longer required. 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.c9
-rw-r--r--refs/packed-backend.c2
-rw-r--r--refs/refs-internal.h2
3 files changed, 5 insertions, 8 deletions
diff --git a/refs/files-backend.c b/refs/files-backend.c
index 9814cbd..3ff5dc5 100644
--- a/refs/files-backend.c
+++ b/refs/files-backend.c
@@ -2908,7 +2908,7 @@ static int expire_reflog_ent(struct object_id *ooid, struct object_id *noid,
}
static int files_reflog_expire(struct ref_store *ref_store,
- const char *refname, const unsigned char *sha1,
+ const char *refname, const struct object_id *oid,
unsigned int flags,
reflog_expiry_prepare_fn prepare_fn,
reflog_expiry_should_prune_fn should_prune_fn,
@@ -2925,7 +2925,6 @@ static int files_reflog_expire(struct ref_store *ref_store,
int status = 0;
int type;
struct strbuf err = STRBUF_INIT;
- struct object_id oid;
memset(&cb, 0, sizeof(cb));
cb.flags = flags;
@@ -2937,7 +2936,7 @@ static int files_reflog_expire(struct ref_store *ref_store,
* reference itself, plus we might need to update the
* reference if --updateref was specified:
*/
- lock = lock_ref_sha1_basic(refs, refname, sha1,
+ lock = lock_ref_sha1_basic(refs, refname, oid->hash,
NULL, NULL, REF_NODEREF,
&type, &err);
if (!lock) {
@@ -2975,9 +2974,7 @@ static int files_reflog_expire(struct ref_store *ref_store,
}
}
- hashcpy(oid.hash, sha1);
-
- (*prepare_fn)(refname, &oid, cb.policy_cb);
+ (*prepare_fn)(refname, oid, cb.policy_cb);
refs_for_each_reflog_ent(ref_store, refname, expire_reflog_ent, &cb);
(*cleanup_fn)(cb.policy_cb);
diff --git a/refs/packed-backend.c b/refs/packed-backend.c
index 3279d42..4ec9fca 100644
--- a/refs/packed-backend.c
+++ b/refs/packed-backend.c
@@ -1519,7 +1519,7 @@ static int packed_delete_reflog(struct ref_store *ref_store,
}
static int packed_reflog_expire(struct ref_store *ref_store,
- const char *refname, const unsigned char *sha1,
+ const char *refname, const struct object_id *oid,
unsigned int flags,
reflog_expiry_prepare_fn prepare_fn,
reflog_expiry_should_prune_fn should_prune_fn,
diff --git a/refs/refs-internal.h b/refs/refs-internal.h
index 951bd34..3c4781e 100644
--- a/refs/refs-internal.h
+++ b/refs/refs-internal.h
@@ -608,7 +608,7 @@ typedef int create_reflog_fn(struct ref_store *ref_store, const char *refname,
int force_create, struct strbuf *err);
typedef int delete_reflog_fn(struct ref_store *ref_store, const char *refname);
typedef int reflog_expire_fn(struct ref_store *ref_store,
- const char *refname, const unsigned char *sha1,
+ const char *refname, const struct object_id *oid,
unsigned int flags,
reflog_expiry_prepare_fn prepare_fn,
reflog_expiry_should_prune_fn should_prune_fn,