diff options
author | Junio C Hamano <gitster@pobox.com> | 2017-08-02 14:34:28 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-08-02 14:34:28 -0700 |
commit | a46ddc992bbac524fb325875c5555dbae0c6355b (patch) | |
tree | ce0aa8084f9cbd2734ee56e24caf1017bb635ffb /config.c | |
parent | Merge branch 'bw/grep-recurse-submodules' into bw/submodule-config-cleanup (diff) | |
parent | sha1_name: convert uses of 40 to GIT_SHA1_HEXSZ (diff) | |
download | tgif-a46ddc992bbac524fb325875c5555dbae0c6355b.tar.xz |
Merge branch 'bc/object-id' into bw/submodule-config-cleanup
* bc/object-id:
sha1_name: convert uses of 40 to GIT_SHA1_HEXSZ
sha1_name: convert GET_SHA1* flags to GET_OID*
sha1_name: convert get_sha1* to get_oid*
Convert remaining callers of get_sha1 to get_oid.
builtin/unpack-file: convert to struct object_id
bisect: convert bisect_checkout to struct object_id
builtin/update_ref: convert to struct object_id
sequencer: convert to struct object_id
remote: convert struct push_cas to struct object_id
submodule: convert submodule config lookup to use object_id
builtin/merge-tree: convert remaining caller of get_sha1 to object_id
builtin/fsck: convert remaining caller of get_sha1 to object_id
tag: convert gpg_verify_tag to use struct object_id
commit: convert lookup_commit_graft to struct object_id
Diffstat (limited to 'config.c')
-rw-r--r-- | config.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -1460,9 +1460,9 @@ int git_config_from_mem(config_fn_t fn, const enum config_origin_type origin_typ return do_config_from(&top, fn, data); } -int git_config_from_blob_sha1(config_fn_t fn, +int git_config_from_blob_oid(config_fn_t fn, const char *name, - const unsigned char *sha1, + const struct object_id *oid, void *data) { enum object_type type; @@ -1470,7 +1470,7 @@ int git_config_from_blob_sha1(config_fn_t fn, unsigned long size; int ret; - buf = read_sha1_file(sha1, &type, &size); + buf = read_sha1_file(oid->hash, &type, &size); if (!buf) return error("unable to load config blob object '%s'", name); if (type != OBJ_BLOB) { @@ -1488,11 +1488,11 @@ static int git_config_from_blob_ref(config_fn_t fn, const char *name, void *data) { - unsigned char sha1[20]; + struct object_id oid; - if (get_sha1(name, sha1) < 0) + if (get_oid(name, &oid) < 0) return error("unable to resolve config blob '%s'", name); - return git_config_from_blob_sha1(fn, name, sha1, data); + return git_config_from_blob_oid(fn, name, &oid, data); } const char *git_etc_gitconfig(void) |