Merge branch 'bc/object-id'
authorJunio C Hamano <gitster@pobox.com>
Thu, 20 Apr 2017 04:37:13 +0000 (21:37 -0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 20 Apr 2017 04:37:13 +0000 (21:37 -0700)
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

19 files changed:
1  2 
bisect.c
builtin/fetch.c
builtin/merge.c
builtin/pack-objects.c
builtin/receive-pack.c
builtin/rev-parse.c
builtin/send-pack.c
cache.h
combine-diff.c
diff.c
ref-filter.c
ref-filter.h
remote-curl.c
remote.h
send-pack.c
sha1_file.c
sha1_name.c
submodule.c
submodule.h
diff --cc bisect.c
Simple merge
diff --cc builtin/fetch.c
Simple merge
diff --cc builtin/merge.c
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc cache.h
Simple merge
diff --cc combine-diff.c
Simple merge
diff --cc diff.c
Simple merge
diff --cc ref-filter.c
Simple merge
diff --cc ref-filter.h
index dde40f68497c5456913a764e5e02433ff5eaf509,e5e177d5f18f78ae7cb2985222266b5fd2396250..c20167aa3c785f0060147204d963537f58617570
@@@ -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 remote-curl.c
Simple merge
diff --cc remote.h
Simple merge
diff --cc send-pack.c
Simple merge
diff --cc sha1_file.c
index 7369f7495a06e40eb885deb2101736c9105d950e,b4666ee5c244cacefb08f1f41968c3f3524cf94b..2270f36a2b12d9f4b2f4c0cb2d8c5b5386aac142
@@@ -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 sha1_name.c
Simple merge
diff --cc submodule.c
Simple merge
diff --cc submodule.h
index 8a8bc49dc9626b9ba4112f3b0bf25b212d864d1d,decca25e370767dab6dd1acba1f19bc9d19f3706..a86f757a06720e1bc85d7e9ecad51ffbc6610dbe
@@@ -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 check_for_new_submodule_commits(unsigned char new_sha1[20]);
 +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(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);