]> git.ipfire.org Git - thirdparty/git.git/commitdiff
read-cache: update add_files_to_cache take param ignored_too
authorClaus Schneider(Eficode) <claus.schneider@eficode.com>
Wed, 14 Jan 2026 07:47:55 +0000 (07:47 +0000)
committerJunio C Hamano <gitster@pobox.com>
Wed, 14 Jan 2026 14:34:52 +0000 (06:34 -0800)
The ignored_too parameter is added to the function
add_files_to_cache for usage of explicit updating the index for the updated
submodule using the explicit patchspec to the submodule.

Signed-off-by: Claus Schneider (Eficode) <claus.schneider@eficode.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/add.c
builtin/checkout.c
builtin/commit.c
read-cache-ll.h
read-cache.c

index 32709794b3873f8a4e73df5338c752271155bca5..eef4959ee31c3d0ee86bc2c91ed6419137eb4205 100644 (file)
@@ -584,7 +584,7 @@ int cmd_add(int argc,
        else
                exit_status |= add_files_to_cache(repo, prefix,
                                                  &pathspec, ps_matched,
-                                                 include_sparse, flags);
+                                                 include_sparse, flags, ignored_too);
 
        if (take_worktree_changes && !add_renormalize && !ignore_add_errors &&
            report_path_error(ps_matched, &pathspec))
index 261699e2f5fc97956c264bc0300b4aee64d1f287..9b664c4bbcb0a3c4e792892d154d652450354b10 100644 (file)
@@ -899,7 +899,7 @@ static int merge_working_tree(const struct checkout_opts *opts,
                         */
 
                        add_files_to_cache(the_repository, NULL, NULL, NULL, 0,
-                                          0);
+                                       0, 0);
                        init_ui_merge_options(&o, the_repository);
                        o.verbosity = 0;
                        work = write_in_core_index_as_tree(the_repository);
index 0243f17d53c97c62432ce77249966d4ef4ed7100..1a0064209062e39fd9bc76e88b47fd17a0b47d84 100644 (file)
@@ -455,7 +455,7 @@ static const char *prepare_index(const char **argv, const char *prefix,
                repo_hold_locked_index(the_repository, &index_lock,
                                       LOCK_DIE_ON_ERROR);
                add_files_to_cache(the_repository, also ? prefix : NULL,
-                                  &pathspec, ps_matched, 0, 0);
+                                  &pathspec, ps_matched, 0, 0, 0 );
                if (!all && report_path_error(ps_matched, &pathspec))
                        exit(128);
 
index 71b49d9af48a9db3faf30b2f23ecd9206dc4160b..2c8b4b21b1c7e97f9c122390da9fd353c97be819 100644 (file)
@@ -481,7 +481,7 @@ int cmp_cache_name_compare(const void *a_, const void *b_);
 
 int add_files_to_cache(struct repository *repo, const char *prefix,
                       const struct pathspec *pathspec, char *ps_matched,
-                      int include_sparse, int flags);
+                      int include_sparse, int flags, int ignored_too );
 
 void overlay_tree_on_index(struct index_state *istate,
                           const char *tree_name, const char *prefix);
index 990d4ead0d8ae462876f276a23c6a475b2b95f8c..5349b94e59176983e9de3bde94f880c7e117aebc 100644 (file)
@@ -3878,9 +3878,12 @@ void overlay_tree_on_index(struct index_state *istate,
 
 struct update_callback_data {
        struct index_state *index;
+       struct repository *repo;
+       struct pathspec *pathspec;
        int include_sparse;
        int flags;
        int add_errors;
+       int ignored_too;
 };
 
 static int fix_unmerged_status(struct diff_filepair *p,
@@ -3922,7 +3925,7 @@ static void update_callback(struct diff_queue_struct *q,
                default:
                        die(_("unexpected diff status %c"), p->status);
                case DIFF_STATUS_MODIFIED:
-               case DIFF_STATUS_TYPE_CHANGED:
+               case DIFF_STATUS_TYPE_CHANGED: {
                        if (add_file_to_index(data->index, path, data->flags)) {
                                if (!(data->flags & ADD_CACHE_IGNORE_ERRORS))
                                        die(_("updating files failed"));
@@ -3943,7 +3946,7 @@ static void update_callback(struct diff_queue_struct *q,
 
 int add_files_to_cache(struct repository *repo, const char *prefix,
                       const struct pathspec *pathspec, char *ps_matched,
-                      int include_sparse, int flags)
+                      int include_sparse, int flags, int ignored_too )
 {
        struct odb_transaction *transaction;
        struct update_callback_data data;
@@ -3953,6 +3956,9 @@ int add_files_to_cache(struct repository *repo, const char *prefix,
        data.index = repo->index;
        data.include_sparse = include_sparse;
        data.flags = flags;
+       data.repo = repo;
+       data.ignored_too = ignored_too;
+       data.pathspec = (struct pathspec *)pathspec;
 
        repo_init_revisions(repo, &rev, prefix);
        setup_revisions(0, NULL, &rev, NULL);