Skip to content

Commit 95a66a1

Browse files
committed
read-cache: update add_files_to_cache to take param ignored_too(--force)
The parameter is parsed to add function and is now also given for usage in read-cache for selective update the submodule sha1. Signed-off-by: Claus Schneider(Eficode) <claus.schneider@eficode.com>
1 parent c44beea commit 95a66a1

File tree

5 files changed

+11
-5
lines changed

5 files changed

+11
-5
lines changed

builtin/add.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,7 @@ int cmd_add(int argc,
582582
else
583583
exit_status |= add_files_to_cache(repo, prefix,
584584
&pathspec, ps_matched,
585-
include_sparse, flags);
585+
include_sparse, flags, ignored_too);
586586

587587
if (take_worktree_changes && !add_renormalize && !ignore_add_errors &&
588588
report_path_error(ps_matched, &pathspec))

builtin/checkout.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -899,7 +899,7 @@ static int merge_working_tree(const struct checkout_opts *opts,
899899
*/
900900

901901
add_files_to_cache(the_repository, NULL, NULL, NULL, 0,
902-
0);
902+
0, 0 );
903903
init_ui_merge_options(&o, the_repository);
904904
o.verbosity = 0;
905905
work = write_in_core_index_as_tree(the_repository);

builtin/commit.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ static const char *prepare_index(const char **argv, const char *prefix,
455455
repo_hold_locked_index(the_repository, &index_lock,
456456
LOCK_DIE_ON_ERROR);
457457
add_files_to_cache(the_repository, also ? prefix : NULL,
458-
&pathspec, ps_matched, 0, 0);
458+
&pathspec, ps_matched, 0, 0, 0 );
459459
if (!all && report_path_error(ps_matched, &pathspec))
460460
exit(128);
461461

read-cache-ll.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@ int cmp_cache_name_compare(const void *a_, const void *b_);
481481

482482
int add_files_to_cache(struct repository *repo, const char *prefix,
483483
const struct pathspec *pathspec, char *ps_matched,
484-
int include_sparse, int flags);
484+
int include_sparse, int flags, int ignored_too );
485485

486486
void overlay_tree_on_index(struct index_state *istate,
487487
const char *tree_name, const char *prefix);

read-cache.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3880,9 +3880,12 @@ void overlay_tree_on_index(struct index_state *istate,
38803880

38813881
struct update_callback_data {
38823882
struct index_state *index;
3883+
struct repository *repo;
3884+
struct pathspec *pathspec;
38833885
int include_sparse;
38843886
int flags;
38853887
int add_errors;
3888+
int ignored_too;
38863889
};
38873890

38883891
static int fix_unmerged_status(struct diff_filepair *p,
@@ -3945,7 +3948,7 @@ static void update_callback(struct diff_queue_struct *q,
39453948

39463949
int add_files_to_cache(struct repository *repo, const char *prefix,
39473950
const struct pathspec *pathspec, char *ps_matched,
3948-
int include_sparse, int flags)
3951+
int include_sparse, int flags, int ignored_too )
39493952
{
39503953
struct update_callback_data data;
39513954
struct rev_info rev;
@@ -3954,6 +3957,9 @@ int add_files_to_cache(struct repository *repo, const char *prefix,
39543957
data.index = repo->index;
39553958
data.include_sparse = include_sparse;
39563959
data.flags = flags;
3960+
data.repo = repo;
3961+
data.ignored_too = ignored_too;
3962+
data.pathspec = (struct pathspec *)pathspec;
39573963

39583964
repo_init_revisions(repo, &rev, prefix);
39593965
setup_revisions(0, NULL, &rev, NULL);

0 commit comments

Comments
 (0)