submodule: rename add_sha1_to_array()
authorBrandon Williams <bmwill@google.com>
Fri, 28 Apr 2017 23:53:57 +0000 (16:53 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 1 May 2017 03:17:10 +0000 (12:17 +0900)
Rename 'add_sha1_to_array()' to 'append_oid_to_array()' to more
accurately describe what the function does, since it handles
'struct object_id' and not sha1 character arrays.

Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
submodule.c
index d3299e29c0855b8503f444f659e2b24bba8ecb1f..be0f5d8478dbb9ee9977cc0cb6819a54e8a0b09f 100644 (file)
@@ -951,17 +951,18 @@ static void submodule_collect_changed_cb(struct diff_queue_struct *q,
        }
 }
 
-static int add_sha1_to_array(const char *ref, const struct object_id *oid,
-                            int flags, void *data)
+static int append_oid_to_array(const char *ref, const struct object_id *oid,
+                              int flags, void *data)
 {
-       oid_array_append(data, oid);
+       struct oid_array *array = data;
+       oid_array_append(array, oid);
        return 0;
 }
 
 void check_for_new_submodule_commits(struct object_id *oid)
 {
        if (!initialized_fetch_ref_tips) {
-               for_each_ref(add_sha1_to_array, &ref_tips_before_fetch);
+               for_each_ref(append_oid_to_array, &ref_tips_before_fetch);
                initialized_fetch_ref_tips = 1;
        }