From: Junio C Hamano Date: Mon, 29 May 2017 03:34:43 +0000 (+0900) Subject: Merge branch 'bc/object-id' X-Git-Tag: v2.14.0-rc0~166 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/6b526ced6fb1808d1b8a9b30010e45dce10a4e7c Merge branch 'bc/object-id' Conversion from uchar[20] to struct object_id continues. * bc/object-id: (53 commits) object: convert parse_object* to take struct object_id tree: convert parse_tree_indirect to struct object_id sequencer: convert do_recursive_merge to struct object_id diff-lib: convert do_diff_cache to struct object_id builtin/ls-tree: convert to struct object_id merge: convert checkout_fast_forward to struct object_id sequencer: convert fast_forward_to to struct object_id builtin/ls-files: convert overlay_tree_on_cache to object_id builtin/read-tree: convert to struct object_id sha1_name: convert internals of peel_onion to object_id upload-pack: convert remaining parse_object callers to object_id revision: convert remaining parse_object callers to object_id revision: rename add_pending_sha1 to add_pending_oid http-push: convert process_ls_object and descendants to object_id refs/files-backend: convert many internals to struct object_id refs: convert struct ref_update to use struct object_id ref-filter: convert some static functions to struct object_id Convert struct ref_array_item to struct object_id Convert the verify_pack callback to struct object_id Convert lookup_tag to struct object_id ... --- 6b526ced6fb1808d1b8a9b30010e45dce10a4e7c diff --cc builtin/checkout.c index 6c3d2e4f4c,13365fb621..65877bacb1 --- a/builtin/checkout.c +++ b/builtin/checkout.c @@@ -833,8 -833,7 +833,8 @@@ static int switch_branches(const struc int flag, writeout_error = 0; memset(&old, 0, sizeof(old)); old.path = path_to_free = resolve_refdup("HEAD", 0, rev.hash, &flag); - old.commit = lookup_commit_reference_gently(&rev, 1); + if (old.path) - old.commit = lookup_commit_reference_gently(rev.hash, 1); ++ old.commit = lookup_commit_reference_gently(&rev, 1); if (!(flag & REF_ISSYMREF)) old.path = NULL; diff --cc builtin/reflog.c index 4228d9ff4d,8f3f1bd997..920c16dac0 --- a/builtin/reflog.c +++ b/builtin/reflog.c @@@ -283,8 -283,8 +283,8 @@@ static int unreachable(struct expire_re /* * Return true iff the specified reflog entry should be expired. */ - static int should_expire_reflog_ent(unsigned char *osha1, unsigned char *nsha1, + static int should_expire_reflog_ent(struct object_id *ooid, struct object_id *noid, - const char *email, unsigned long timestamp, int tz, + const char *email, timestamp_t timestamp, int tz, const char *message, void *cb_data) { struct expire_reflog_policy_cb *cb = cb_data; diff --cc builtin/tag.c index bdf1e88e93,d0070b37c2..1f74a56db7 --- a/builtin/tag.c +++ b/builtin/tag.c @@@ -309,18 -309,18 +309,18 @@@ static void create_reflog_msg(const str if (rla) { strbuf_addstr(sb, rla); } else { - strbuf_addstr(sb, _("tag: tagging ")); + strbuf_addstr(sb, "tag: tagging "); - strbuf_add_unique_abbrev(sb, sha1, DEFAULT_ABBREV); + strbuf_add_unique_abbrev(sb, oid->hash, DEFAULT_ABBREV); } strbuf_addstr(sb, " ("); - type = sha1_object_info(sha1, NULL); + type = sha1_object_info(oid->hash, NULL); switch (type) { default: - strbuf_addstr(sb, _("object of unknown type")); + strbuf_addstr(sb, "object of unknown type"); break; case OBJ_COMMIT: - if ((buf = read_sha1_file(sha1, &type, &size)) != NULL) { + if ((buf = read_sha1_file(oid->hash, &type, &size)) != NULL) { subject_len = find_commit_subject(buf, &subject_start); strbuf_insert(sb, sb->len, subject_start, subject_len); } else { diff --cc refs.h index d18ef47128,a22f696ddc..685a979a0e --- a/refs.h +++ b/refs.h @@@ -602,12 -611,12 +602,12 @@@ enum expire_reflog_flags * unlocked again. */ typedef void reflog_expiry_prepare_fn(const char *refname, - const unsigned char *sha1, + const struct object_id *oid, void *cb_data); - typedef int reflog_expiry_should_prune_fn(unsigned char *osha1, - unsigned char *nsha1, + typedef int reflog_expiry_should_prune_fn(struct object_id *ooid, + struct object_id *noid, const char *email, - unsigned long timestamp, int tz, + timestamp_t timestamp, int tz, const char *message, void *cb_data); typedef void reflog_expiry_cleanup_fn(void *cb_data); diff --cc tag.h index 2abb3726fb,8d6fc28145..fdfcb4a84a --- a/tag.h +++ b/tag.h @@@ -9,10 -9,10 +9,10 @@@ struct tag struct object object; struct object *tagged; char *tag; - unsigned long date; + timestamp_t date; }; - extern struct tag *lookup_tag(const unsigned char *sha1); + extern struct tag *lookup_tag(const struct object_id *oid); extern int parse_tag_buffer(struct tag *item, const void *data, unsigned long size); extern int parse_tag(struct tag *item); extern struct object *deref_tag(struct object *, const char *, int);