]> git.ipfire.org Git - thirdparty/git.git/commitdiff
post-cocci: adjust comments for recent repo_* migration
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Tue, 28 Mar 2023 13:58:57 +0000 (15:58 +0200)
committerJunio C Hamano <gitster@pobox.com>
Tue, 28 Mar 2023 14:36:46 +0000 (07:36 -0700)
In preceding commits we changed many calls to macros that were
providing a "the_repository" argument to invoke corresponding repo_*()
function instead. Let's follow-up and adjust references to those in
comments, which coccinelle didn't (and inherently can't) catch.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/branch.c
builtin/shortlog.c
cache.h
commit.h
diff.h
object-file.c
object-store.h
pretty.c
refs.c
sequencer.c
strbuf.h

index bbcfb34b3c65299a73d2b9b33d2b34d86c3ddf53..45910039e6b63cf4bcfd200cf2975e7fd2c7fb28 100644 (file)
@@ -156,7 +156,7 @@ static int branch_merged(int kind, const char *name,
        /*
         * After the safety valve is fully redefined to "check with
         * upstream, if any, otherwise with HEAD", we should just
-        * return the result of the in_merge_bases() above without
+        * return the result of the repo_in_merge_bases() above without
         * any of the following code, but during the transition period,
         * a gentle reminder is in order.
         */
index 62f91b8b9323d492308ddb3e279e998d782a722f..f287a6acd0325468d0178acbcc97641f7a079957 100644 (file)
@@ -176,7 +176,7 @@ static void insert_records_from_trailers(struct shortlog *log,
                return;
 
        /*
-        * Using format_commit_message("%B") would be simpler here, but
+        * Using repo_format_commit_message("%B") would be simpler here, but
         * this saves us copying the message.
         */
        commit_buffer = repo_logmsg_reencode(the_repository, commit, NULL,
diff --git a/cache.h b/cache.h
index d835ac8b4d204cc67bd470482c95214d42bb06b8..555354e1961546793235d531dd92ff14899d311f 100644 (file)
--- a/cache.h
+++ b/cache.h
@@ -443,7 +443,7 @@ void validate_cache_entries(const struct index_state *istate);
 /*
  * Bulk prefetch all missing cache entries that are not GITLINKs and that match
  * the given predicate. This function should only be called if
- * has_promisor_remote() returns true.
+ * repo_has_promisor_remote() returns true.
  */
 typedef int (*must_prefetch_predicate)(const struct cache_entry *);
 void prefetch_cache_entries(const struct index_state *istate,
@@ -1201,7 +1201,7 @@ void check_repository_format(struct repository_format *fmt);
  * terminated.
  *
  * The non-`_r` version returns a static buffer which remains valid until 4
- * more calls to find_unique_abbrev are made.
+ * more calls to repo_find_unique_abbrev are made.
  *
  * The `_r` variant writes to a buffer supplied by the caller, which must be at
  * least `GIT_MAX_HEXSZ + 1` bytes. The return value is the number of bytes
index e98ee6e698e61c6e39d91c7776a67b710e4b3810..d4adf111019db199ff1c2c24d882bef5676afe84 100644 (file)
--- a/commit.h
+++ b/commit.h
@@ -130,7 +130,7 @@ const void *get_cached_commit_buffer(struct repository *, const struct commit *,
 /*
  * Get the commit's object contents, either from cache or by reading the object
  * from disk. The resulting memory should not be modified, and must be given
- * to unuse_commit_buffer when the caller is done.
+ * to repo_unuse_commit_buffer when the caller is done.
  */
 const void *repo_get_commit_buffer(struct repository *r,
                                   const struct commit *,
@@ -139,7 +139,7 @@ const void *repo_get_commit_buffer(struct repository *r,
 /*
  * Tell the commit subsystem that we are done with a particular commit buffer.
  * The commit and buffer should be the input and return value, respectively,
- * from an earlier call to get_commit_buffer.  The buffer may or may not be
+ * from an earlier call to repo_get_commit_buffer.  The buffer may or may not be
  * freed by this call; callers should not access the memory afterwards.
  */
 void repo_unuse_commit_buffer(struct repository *r,
diff --git a/diff.h b/diff.h
index 8b510eb579d77643dd2b5e9035556e42e5f5478b..0aa36e8126170be2e46dd88de1f95189d33a232e 100644 (file)
--- a/diff.h
+++ b/diff.h
@@ -614,7 +614,7 @@ void diff_warn_rename_limit(const char *varname, int needed, int degraded_cc);
 #define DIFF_STATUS_FILTER_BROKEN      'B'
 
 /*
- * This is different from find_unique_abbrev() in that
+ * This is different from repo_find_unique_abbrev() in that
  * it stuffs the result with dots for alignment.
  */
 const char *diff_aligned_abbrev(const struct object_id *sha1, int);
index 141cf85f25bd1b9601384cbff65505ca1586a0f8..47c52681640dedb5eac486a01b3942321e1c120e 100644 (file)
@@ -267,7 +267,7 @@ int hash_algo_by_length(int len)
 
 /*
  * This is meant to hold a *small* number of objects that you would
- * want read_object_file() to be able to return, but yet you do not want
+ * want repo_read_object_file() to be able to return, but yet you do not want
  * to write them into the object store (e.g. a browse-only
  * application).
  */
index b47849d4e7e22281b6cf243a698aa6def5b9b166..9217ae83064fb62c87454c1143483ea675638bc4 100644 (file)
@@ -216,7 +216,7 @@ struct raw_object_store {
        /*
         * A fast, rough count of the number of objects in the repository.
         * These two fields are not meant for direct access. Use
-        * approximate_object_count() instead.
+        * repo_approximate_object_count() instead.
         */
        unsigned long approximate_object_count;
        unsigned approximate_object_count_valid : 1;
@@ -343,7 +343,7 @@ void assert_oid_type(const struct object_id *oid, enum object_type expect);
 
 /*
  * Enabling the object read lock allows multiple threads to safely call the
- * following functions in parallel: repo_read_object_file(), read_object_file(),
+ * following functions in parallel: repo_read_object_file(),
  * read_object_with_reference(), oid_object_info() and oid_object_info_extended().
  *
  * obj_read_lock() and obj_read_unlock() may also be used to protect other
index 076d1c363e7237fbc8002f1a8016609c7ff81e63..23ac06b93f3253be07ca0d53e1f78e279219b0d9 100644 (file)
--- a/pretty.c
+++ b/pretty.c
@@ -719,7 +719,7 @@ const char *repo_logmsg_reencode(struct repository *r,
                 * Otherwise, we still want to munge the encoding header in the
                 * result, which will be done by modifying the buffer. If we
                 * are using a fresh copy, we can reuse it. But if we are using
-                * the cached copy from get_commit_buffer, we need to duplicate it
+                * the cached copy from repo_get_commit_buffer, we need to duplicate it
                 * to avoid munging the cached copy.
                 */
                if (msg == get_cached_commit_buffer(r, commit, NULL))
diff --git a/refs.c b/refs.c
index aeae31c972f8c88084cc3d052329a3e23e60f1d4..cd7537bce6443da082b1659fc903b2c289c6c878 100644 (file)
--- a/refs.c
+++ b/refs.c
@@ -1821,7 +1821,7 @@ const char *refs_resolve_ref_unsafe(struct ref_store *refs,
                        return NULL;
 
                /*
-                * dwim_ref() uses REF_ISBROKEN to distinguish between
+                * repo_dwim_ref() uses REF_ISBROKEN to distinguish between
                 * missing refs and refs that were present but invalid,
                 * to complain about the latter to stderr.
                 *
index aa3ebb47d98f651fefbb277f5fca4d5ac2bed617..fb5a540fa048234030783839adb794d4e2ebb583 100644 (file)
@@ -768,9 +768,9 @@ static int is_index_unchanged(struct repository *r)
        /*
         * If head_commit is NULL, check_commit, called from
         * lookup_commit, would have indicated that head_commit is not
-        * a commit object already.  parse_commit() will return failure
+        * a commit object already.  repo_parse_commit() will return failure
         * without further complaints in such a case.  Otherwise, if
-        * the commit is invalid, parse_commit() will complain.  So
+        * the commit is invalid, repo_parse_commit() will complain.  So
         * there is nothing for us to say here.  Just return failure.
         */
        if (repo_parse_commit(the_repository, head_commit))
@@ -5365,7 +5365,7 @@ static const char *label_oid(struct object_id *oid, const char *label,
         * For "uninteresting" commits, i.e. commits that are not to be
         * rebased, and which can therefore not be labeled, we use a unique
         * abbreviation of the commit name. This is slightly more complicated
-        * than calling find_unique_abbrev() because we also need to make
+        * than calling repo_find_unique_abbrev() because we also need to make
         * sure that the abbreviation does not conflict with any other
         * label.
         *
index f6dbb9681ee768221e707a39c37dc0a00f63b95d..b980f9edc6d9b79dd0319b06d13f9e5165624653 100644 (file)
--- a/strbuf.h
+++ b/strbuf.h
@@ -631,7 +631,7 @@ void strbuf_add_separated_string_list(struct strbuf *str,
 void strbuf_list_free(struct strbuf **list);
 
 /**
- * Add the abbreviation, as generated by find_unique_abbrev, of `sha1` to
+ * Add the abbreviation, as generated by repo_find_unique_abbrev(), of `sha1` to
  * the strbuf `sb`.
  */
 struct repository;
@@ -706,14 +706,14 @@ static inline void strbuf_complete_line(struct strbuf *sb)
 
 /*
  * Copy "name" to "sb", expanding any special @-marks as handled by
- * interpret_branch_name(). The result is a non-qualified branch name
+ * repo_interpret_branch_name(). The result is a non-qualified branch name
  * (so "foo" or "origin/master" instead of "refs/heads/foo" or
  * "refs/remotes/origin/master").
  *
  * Note that the resulting name may not be a syntactically valid refname.
  *
  * If "allowed" is non-zero, restrict the set of allowed expansions. See
- * interpret_branch_name() for details.
+ * repo_interpret_branch_name() for details.
  */
 void strbuf_branchname(struct strbuf *sb, const char *name,
                       unsigned allowed);