Merge branch 'bc/object-id'
authorJunio C Hamano <gitster@pobox.com>
Mon, 29 May 2017 03:34:43 +0000 (12:34 +0900)
committerJunio C Hamano <gitster@pobox.com>
Mon, 29 May 2017 03:34:43 +0000 (12:34 +0900)
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
...

48 files changed:
1  2 
branch.c
builtin/am.c
builtin/blame.c
builtin/checkout.c
builtin/clone.c
builtin/commit.c
builtin/fsck.c
builtin/grep.c
builtin/log.c
builtin/ls-files.c
builtin/merge-base.c
builtin/name-rev.c
builtin/pack-objects.c
builtin/prune.c
builtin/receive-pack.c
builtin/reflog.c
builtin/reset.c
builtin/rev-list.c
builtin/rev-parse.c
builtin/show-branch.c
builtin/tag.c
bundle.c
cache-tree.c
cache.h
commit.c
commit.h
diff.c
fetch-pack.c
fsck.c
http-backend.c
parse-options-cb.c
pretty.c
reachable.c
ref-filter.c
reflog-walk.c
refs.c
refs.h
refs/files-backend.c
refs/refs-internal.h
revision.c
revision.h
sequencer.c
sha1_name.c
submodule.c
tag.c
tag.h
upload-pack.c
wt-status.c
diff --cc branch.c
Simple merge
diff --cc builtin/am.c
Simple merge
diff --cc builtin/blame.c
Simple merge
index 6c3d2e4f4cca135fa0d2562f2bcaa0af8a6aa340,13365fb621f548e5c3320d33b43ba1a64817bc16..65877bacb1ed65139bacfb479ced4e322a972eb5
@@@ -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/clone.c
Simple merge
Simple merge
diff --cc builtin/fsck.c
Simple merge
diff --cc builtin/grep.c
Simple merge
diff --cc builtin/log.c
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc builtin/prune.c
Simple merge
Simple merge
index 4228d9ff4dbeb0d423ec513809844cbcb8655225,8f3f1bd997498e48b39cd75212a04ba9663a8ae7..920c16dac025b0f5650b0f91511c22359d5bda2d
@@@ -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/reset.c
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc builtin/tag.c
index bdf1e88e93a61b6cbe840f4c8dd4563c1e13e337,d0070b37c215ca209c31ae1d9e774fe4944f806e..1f74a56db749a5e1ffa06715e347cdc1b041033b
@@@ -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 bundle.c
Simple merge
diff --cc cache-tree.c
Simple merge
diff --cc cache.h
Simple merge
diff --cc commit.c
Simple merge
diff --cc commit.h
Simple merge
diff --cc diff.c
Simple merge
diff --cc fetch-pack.c
Simple merge
diff --cc fsck.c
Simple merge
diff --cc http-backend.c
Simple merge
Simple merge
diff --cc pretty.c
Simple merge
diff --cc reachable.c
Simple merge
diff --cc ref-filter.c
Simple merge
diff --cc reflog-walk.c
Simple merge
diff --cc refs.c
Simple merge
diff --cc refs.h
index d18ef47128688b6bee35b4bd5ae5c42bc3e6690e,a22f696ddc702732c593df57d4b17e26fb9a1f92..685a979a0eb70b1f49b455c279f51c9c392a3d3c
--- 1/refs.h
--- 2/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);
  
Simple merge
Simple merge
diff --cc revision.c
Simple merge
diff --cc revision.h
Simple merge
diff --cc sequencer.c
Simple merge
diff --cc sha1_name.c
Simple merge
diff --cc submodule.c
Simple merge
diff --cc tag.c
Simple merge
diff --cc tag.h
index 2abb3726fb5c289a5ef2c90716ec1a01f28169d6,8d6fc28145af5467a0b9b942333ddd153760355d..fdfcb4a84aa16b8173f8f308f7faecf8e9f000c7
--- 1/tag.h
--- 2/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);
diff --cc upload-pack.c
Simple merge
diff --cc wt-status.c
Simple merge