From: Junio C Hamano Date: Thu, 20 Apr 2017 04:37:13 +0000 (-0700) Subject: Merge branch 'bc/object-id' X-Git-Tag: v2.13.0-rc0~16 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b1081e4004091947b6c6a806625addd1cbba61b7;p=thirdparty%2Fgit.git Merge branch 'bc/object-id' Conversion from unsigned char [40] to struct object_id continues. * bc/object-id: Documentation: update and rename api-sha1-array.txt Rename sha1_array to oid_array Convert sha1_array_for_each_unique and for_each_abbrev to object_id Convert sha1_array_lookup to take struct object_id Convert remaining callers of sha1_array_lookup to object_id Make sha1_array_append take a struct object_id * sha1-array: convert internal storage for struct sha1_array to object_id builtin/pull: convert to struct object_id submodule: convert check_for_new_submodule_commits to object_id sha1_name: convert disambiguate_hint_fn to take object_id sha1_name: convert struct disambiguate_state to object_id test-sha1-array: convert most code to struct object_id parse-options-cb: convert sha1_array_append caller to struct object_id fsck: convert init_skiplist to struct object_id builtin/receive-pack: convert portions to struct object_id builtin/pull: convert portions to struct object_id builtin/diff: convert to struct object_id Convert GIT_SHA1_RAWSZ used for allocation to GIT_MAX_RAWSZ Convert GIT_SHA1_HEXSZ used for allocation to GIT_MAX_HEXSZ Define new hash-size constants for allocating memory --- b1081e4004091947b6c6a806625addd1cbba61b7 diff --cc ref-filter.h index dde40f6849,e5e177d5f1..c20167aa3c --- a/ref-filter.h +++ b/ref-filter.h @@@ -51,9 -51,8 +51,9 @@@ struct ref_array struct ref_filter { const char **name_patterns; - struct sha1_array points_at; + struct oid_array points_at; struct commit_list *with_commit; + struct commit_list *no_commit; enum { REF_FILTER_MERGED_NONE = 0, diff --cc sha1_file.c index 7369f7495a,b4666ee5c2..2270f36a2b --- a/sha1_file.c +++ b/sha1_file.c @@@ -3759,11 -3759,11 +3759,11 @@@ static int for_each_file_in_obj_subdir( strbuf_addf(path, "/%s", de->d_name); if (strlen(de->d_name) == GIT_SHA1_HEXSZ - 2) { - char hex[GIT_SHA1_HEXSZ+1]; + char hex[GIT_MAX_HEXSZ+1]; struct object_id oid; - snprintf(hex, sizeof(hex), "%02x%s", - subdir_nr, de->d_name); + xsnprintf(hex, sizeof(hex), "%02x%s", + subdir_nr, de->d_name); if (!get_oid_hex(hex, &oid)) { if (obj_cb) { r = obj_cb(&oid, path->buf, data); diff --cc submodule.h index 8a8bc49dc9,decca25e37..a86f757a06 --- a/submodule.h +++ b/submodule.h @@@ -64,15 -58,7 +64,15 @@@ extern void show_submodule_inline_diff( const char *del, const char *add, const char *reset, const struct diff_options *opt); extern void set_config_fetch_recurse_submodules(int value); +extern void set_config_update_recurse_submodules(int value); +/* Check if we want to update any submodule.*/ +extern int should_update_submodules(void); +/* + * Returns the submodule struct if the given ce entry is a submodule + * and it should be updated. Returns NULL otherwise. + */ +extern const struct submodule *submodule_from_ce(const struct cache_entry *ce); - extern void check_for_new_submodule_commits(unsigned char new_sha1[20]); + extern void check_for_new_submodule_commits(struct object_id *oid); extern int fetch_populated_submodules(const struct argv_array *options, const char *prefix, int command_line_option, int quiet, int max_parallel_jobs);