From: Junio C Hamano Date: Mon, 6 Nov 2017 05:24:27 +0000 (+0900) Subject: Merge branch 'bc/object-id' X-Git-Tag: v2.16.0-rc0~163 X-Git-Url: http://git.bitbasher.net/?a=commitdiff_plain;h=e7e456f5007f30997e48dec57a1fc09b6b0f071e;p=git.git Merge branch 'bc/object-id' Conversion from uchar[20] to struct object_id continues. * bc/object-id: (25 commits) refs/files-backend: convert static functions to object_id refs: convert read_raw_ref backends to struct object_id refs: convert peel_object to struct object_id refs: convert resolve_ref_unsafe to struct object_id worktree: convert struct worktree to object_id refs: convert resolve_gitlink_ref to struct object_id Convert remaining callers of resolve_gitlink_ref to object_id sha1_file: convert index_path and index_fd to struct object_id refs: convert reflog_expire parameter to struct object_id refs: convert read_ref_at to struct object_id refs: convert peel_ref to struct object_id builtin/pack-objects: convert to struct object_id pack-bitmap: convert traverse_bitmap_commit_list to object_id refs: convert dwim_log to struct object_id builtin/reflog: convert remaining unsigned char uses to object_id refs: convert dwim_ref and expand_ref to struct object_id refs: convert read_ref and read_ref_full to object_id refs: convert resolve_refdup and refs_resolve_refdup to struct object_id Convert check_connected to use struct object_id refs: update ref transactions to use struct object_id ... --- e7e456f5007f30997e48dec57a1fc09b6b0f071e diff --cc builtin/checkout.c index fcff0de198,463a337e5d..6c2b4cd419 --- a/builtin/checkout.c +++ b/builtin/checkout.c @@@ -374,10 -376,10 +374,10 @@@ static int checkout_paths(const struct } errs |= finish_delayed_checkout(&state); - if (write_locked_index(&the_index, lock_file, COMMIT_LOCK)) + if (write_locked_index(&the_index, &lock_file, COMMIT_LOCK)) die(_("unable to write new index file")); - read_ref_full("HEAD", 0, rev.hash, NULL); + read_ref_full("HEAD", 0, &rev, NULL); head = lookup_commit_reference_gently(&rev, 1); errs |= post_checkout_hook(head, head, 0); diff --cc dir.c index 9987011da5,f09a31e102..fc2bdc79fc --- a/dir.c +++ b/dir.c @@@ -1390,9 -1390,9 +1390,9 @@@ static enum path_treatment treat_direct if (dir->flags & DIR_SHOW_OTHER_DIRECTORIES) break; if (!(dir->flags & DIR_NO_GITLINKS)) { - unsigned char sha1[20]; - if (resolve_gitlink_ref(dirname, "HEAD", sha1) == 0) + struct object_id oid; + if (resolve_gitlink_ref(dirname, "HEAD", &oid) == 0) - return path_untracked; + return exclude ? path_excluded : path_untracked; } return path_recurse; } diff --cc t/helper/test-ref-store.c index 6ec2670044,d846c88ed2..7120634b04 --- a/t/helper/test-ref-store.c +++ b/t/helper/test-ref-store.c @@@ -134,8 -134,8 +134,8 @@@ static int cmd_resolve_ref(struct ref_s const char *ref; ref = refs_resolve_ref_unsafe(refs, refname, resolve_flags, - sha1, &flags); - printf("%s %s 0x%x\n", sha1_to_hex(sha1), ref ? ref : "(null)", flags); + &oid, &flags); - printf("%s %s 0x%x\n", oid_to_hex(&oid), ref, flags); ++ printf("%s %s 0x%x\n", oid_to_hex(&oid), ref ? ref : "(null)", flags); return ref ? 0 : 1; }