We renamed the actual data structure in 910650d2f8 (Rename sha1_array to
oid_array, 2017-03-31), but the file is still called sha1-array. Besides
being slightly confusing, it makes it more annoying to grep for leftover
occurrences of "sha1" in various files, because the header is included
in so many places.
Let's complete the transition by renaming the source and header files
(and fixing up a few comment references).
I kept the "-" in the name, as that seems to be our style; cf.
fc1395f4a4 (sha1_file.c: rename to use dash in file name, 2018-04-10).
We also have oidmap.h and oidset.h without any punctuation, but those
are "struct oidmap" and "struct oidset" in the code. We _could_ make
this "oidarray" to match, but somehow it looks uglier to me because of
the length of "array" (plus it would be a very invasive patch for little
gain).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jeff King committedMar 30, 2020 at 10:03 UTCfe299ec5ae7b419990bbc3efd4e6bfa3f0773b45
similarity index 96%rename from sha1-array.crename to oid-array.cindex bada0c4353..8657a5cedf 100644--- a/sha1-array.c+++ b/oid-array.c@@ -1,5 +1,5 @@ #include "cache.h"-#include "sha1-array.h"+#include "oid-array.h" #include "sha1-lookup.h" void oid_array_append(struct oid_array *array, const struct object_id *oid)@@ -48,7 +48,7 @@ int oid_array_for_each(struct oid_array *array, { size_t i;- /* No oid_array_sort() here! See sha1-array.h */+ /* No oid_array_sort() here! See oid-array.h */ for (i = 0; i < array->nr; i++) { int ret = fn(array->oid + i, data);
oid-array.h
+1-1
similarity index 98%rename from sha1-array.hrename to oid-array.hindex c5e4b9324f..f28d322c90 100644--- a/sha1-array.h+++ b/oid-array.h@@ -19,7 +19,7 @@ * * void some_func(void) * {- * struct sha1_array hashes = OID_ARRAY_INIT;+ * struct oid_array hashes = OID_ARRAY_INIT; * struct object_id oid; * * // Read objects into our set
parse-options-cb.c
+1-1
index a28b55be48..86cd393013 100644--- a/parse-options-cb.c+++ b/parse-options-cb.c@@ -5,7 +5,7 @@ #include "color.h" #include "string-list.h" #include "argv-array.h"-#include "sha1-array.h"+#include "oid-array.h" /*----- some often used options -----*/