Skip to content

Commit e45daed

Browse files
committed
clean-up tailing spaces, traces, writings and shell spellcheck in test
1 parent 1b8d93b commit e45daed

File tree

6 files changed

+11
-10
lines changed

6 files changed

+11
-10
lines changed

Documentation/gitmodules.adoc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,10 @@ submodule.<name>.ignore::
7070
--
7171
all;; The submodule will never be considered modified (but will
7272
nonetheless show up in the output of status and commit when it has
73-
been staged). Add `(new commits)` can be overruled using the
74-
`git add --force` similar to ignored files. For `status`,
75-
`update-index`, `diff` and `log`(due to underlaying `diff`)
73+
been staged). Add `(new commits)` can be overruled using the
74+
`git add --force <submodule.path>` similar to ignored files. The setting has effect
75+
for `status`, `update-index`, `diff` and `log`(due to underlaying
76+
`diff`)
7677

7778
dirty;; All changes to the submodule's work tree will be ignored, only
7879
committed differences between the `HEAD` of the submodule and its

builtin/add.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
*/
66

77
#include "builtin.h"
8-
#include "trace.h"
98
#include "advice.h"
109
#include "config.h"
1110
#include "environment.h"
@@ -581,7 +580,6 @@ int cmd_add(int argc,
581580
if (add_renormalize)
582581
exit_status |= renormalize_tracked_files(repo, &pathspec, flags);
583582
else
584-
trace_printf("DEBUG ignored_too=%d\n", ignored_too);
585583
exit_status |= add_files_to_cache(repo, prefix,
586584
&pathspec, ps_matched,
587585
include_sparse, flags, ignored_too);

builtin/checkout.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -898,7 +898,6 @@ static int merge_working_tree(const struct checkout_opts *opts,
898898
* entries in the index.
899899
*/
900900

901-
printf("adding files to index\n");
902901
add_files_to_cache(the_repository, NULL, NULL, NULL, 0,
903902
0, 0 );
904903
init_ui_merge_options(&o, the_repository);

builtin/commit.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,6 @@ static const char *prepare_index(const char **argv, const char *prefix,
454454
char *ps_matched = xcalloc(pathspec.nr, 1);
455455
repo_hold_locked_index(the_repository, &index_lock,
456456
LOCK_DIE_ON_ERROR);
457-
printf("commit.c adding files to index\n");
458457
add_files_to_cache(the_repository, also ? prefix : NULL,
459458
&pathspec, ps_matched, 0, 0, 0 );
460459
if (!all && report_path_error(ps_matched, &pathspec))

read-cache.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3959,8 +3959,8 @@ static void update_callback(struct diff_queue_struct *q,
39593959
if (data->ignored_too && data->ignored_too > 0) {
39603960
trace_printf("Forcing add of submodule ignored=all due to --force: %s\n", path);
39613961
} else {
3962-
printf("Skipping submodule due to ignore=all: %s\n", path);
3963-
printf(" Use -f|--force if you really want to add the update to the index.\n");
3962+
printf(_("Skipping submodule due to ignore=all: %s"), path);
3963+
printf(_("Use -f if you really want to add them.") );
39643964
continue;
39653965
}
39663966
} else {
@@ -3994,6 +3994,7 @@ int add_files_to_cache(struct repository *repo, const char *prefix,
39943994
{
39953995
struct update_callback_data data;
39963996
struct rev_info rev;
3997+
39973998
memset(&data, 0, sizeof(data));
39983999
data.repo = repo;
39994000
data.index = repo->index;
@@ -4002,7 +4003,6 @@ int add_files_to_cache(struct repository *repo, const char *prefix,
40024003
data.ignored_too = ignored_too;
40034004
data.pathspec = (struct pathspec *)pathspec;
40044005

4005-
40064006
repo_init_revisions(repo, &rev, prefix);
40074007
setup_revisions(0, NULL, &rev, NULL);
40084008
if (pathspec) {

t/t2206-add-submodule-ignored.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
#!/bin/sh
2+
# shellcheck disable=SC2016
23

4+
5+
# shellcheck disable=SC2034
36
test_description='git add respects submodule ignore=all and explicit pathspec'
47

58
# This test covers the behavior of "git add", "git status" and "git log" when
69
# dealing with submodules that have the ignore=all setting in
710
# .gitmodules. It ensures that changes in such submodules are
811
# ignored by default, but can be staged with "git add --force".
912

13+
# shellcheck disable=SC1091
1014
. ./test-lib.sh
1115

1216
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main

0 commit comments

Comments
 (0)