Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/refs.c
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2017-02-22 02:47:32 +0300
committerJunio C Hamano <gitster@pobox.com>2017-02-22 21:12:15 +0300
commit9461d27240c158cf781ce706a077663050179b14 (patch)
treeb7cd7ab70db3881689f8afb068c3a4a25f4f5784 /refs.c
parent8ebc3fd01bcedcb9a442da1114f37d1a4b8869a0 (diff)
refs: convert each_reflog_ent_fn to struct object_id
Make each_reflog_ent_fn take two struct object_id pointers instead of two pointers to unsigned char. Convert the various callbacks to use struct object_id as well. Also, rename fsck_handle_reflog_sha1 to fsck_handle_reflog_oid. 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.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/refs.c b/refs.c
index cd36b64ed93..b900626d3f9 100644
--- a/refs.c
+++ b/refs.c
@@ -674,7 +674,7 @@ struct read_ref_at_cb {
int *cutoff_cnt;
};
-static int read_ref_at_ent(unsigned char *osha1, unsigned char *nsha1,
+static int read_ref_at_ent(struct object_id *ooid, struct object_id *noid,
const char *email, unsigned long timestamp, int tz,
const char *message, void *cb_data)
{
@@ -698,30 +698,30 @@ static int read_ref_at_ent(unsigned char *osha1, unsigned char *nsha1,
* hold the values for the previous record.
*/
if (!is_null_sha1(cb->osha1)) {
- hashcpy(cb->sha1, nsha1);
- if (hashcmp(cb->osha1, nsha1))
+ hashcpy(cb->sha1, noid->hash);
+ if (hashcmp(cb->osha1, noid->hash))
warning("Log for ref %s has gap after %s.",
cb->refname, show_date(cb->date, cb->tz, DATE_MODE(RFC2822)));
}
else if (cb->date == cb->at_time)
- hashcpy(cb->sha1, nsha1);
- else if (hashcmp(nsha1, cb->sha1))
+ hashcpy(cb->sha1, noid->hash);
+ else if (hashcmp(noid->hash, cb->sha1))
warning("Log for ref %s unexpectedly ended on %s.",
cb->refname, show_date(cb->date, cb->tz,
DATE_MODE(RFC2822)));
- hashcpy(cb->osha1, osha1);
- hashcpy(cb->nsha1, nsha1);
+ hashcpy(cb->osha1, ooid->hash);
+ hashcpy(cb->nsha1, noid->hash);
cb->found_it = 1;
return 1;
}
- hashcpy(cb->osha1, osha1);
- hashcpy(cb->nsha1, nsha1);
+ hashcpy(cb->osha1, ooid->hash);
+ hashcpy(cb->nsha1, noid->hash);
if (cb->cnt > 0)
cb->cnt--;
return 0;
}
-static int read_ref_at_ent_oldest(unsigned char *osha1, unsigned char *nsha1,
+static int read_ref_at_ent_oldest(struct object_id *ooid, struct object_id *noid,
const char *email, unsigned long timestamp,
int tz, const char *message, void *cb_data)
{
@@ -735,9 +735,9 @@ static int read_ref_at_ent_oldest(unsigned char *osha1, unsigned char *nsha1,
*cb->cutoff_tz = tz;
if (cb->cutoff_cnt)
*cb->cutoff_cnt = cb->reccnt;
- hashcpy(cb->sha1, osha1);
+ hashcpy(cb->sha1, ooid->hash);
if (is_null_sha1(cb->sha1))
- hashcpy(cb->sha1, nsha1);
+ hashcpy(cb->sha1, noid->hash);
/* We just want the first entry */
return 1;
}