@@ -3920,6 +3920,8 @@ static void update_callback(struct diff_queue_struct *q,
39203920 struct diff_filepair * p = q -> queue [i ];
39213921 const char * path = p -> one -> path ;
39223922
3923+ trace_printf ("File '%s'\n" , path );
3924+
39233925 if (!data -> include_sparse &&
39243926 !path_in_sparse_checkout (path , data -> index ))
39253927 continue ;
@@ -3928,30 +3930,19 @@ static void update_callback(struct diff_queue_struct *q,
39283930 default :
39293931 die (_ ("unexpected diff status %c" ), p -> status );
39303932 case DIFF_STATUS_MODIFIED :
3931- const struct submodule * sub = submodule_from_path (data -> repo , NULL , path );
3932- if (sub ) {
3933- if ( sub -> ignore ) {
3934- trace_printf ("ignore=%s\n" , sub -> ignore );
3935- if (strcmp (sub -> ignore , "all" ) == 0 ) {
3936- trace_printf ("ignore=all - test\n" );
3937- if ( data -> ignored_too ) {
3938- trace_printf ("ignored_too=%d --force given\n" , data -> ignored_too );
3939- if ( data -> ignored_too > 0 ) {
3940- trace_printf ("Adding submodule even ignore=all is due to --force|-f: %s\n" , path );
3941- } else {
3942- printf ("Skipping submodule with ignore=all: %s\n" , path );
3943- printf (" Use -f if you really want to add them." );
3944- continue ;
3945- }
3946- } else {
3947- trace_printf ("--force not set" );
3948- continue ;
3949- }
3950- } else {
3951- trace_printf ("Skipping submodule with ignore=all: %s\n" , path );
3952- trace_printf (" Use -f if you really want to add them." );
3953- continue ;
3954- }
3933+ trace_printf ("diff modified '%s'\n" , path );
3934+ const struct submodule * sub = submodule_from_path (data -> repo , null_oid (the_hash_algo ), path );
3935+ if ( sub && sub -> name )
3936+ trace_printf (" submodule %s\n" , sub -> name );
3937+ if ( sub && sub -> name && sub -> ignore && strcmp (sub -> ignore , "all" ) == 0 ) {
3938+ trace_printf ("ignore=all %s\n" , path );
3939+ if ( data -> ignored_too && data -> ignored_too > 0 ) {
3940+ trace_printf ("Adding submodule even ignore=all is due to --force|-f: %s\n" , path );
3941+ } else {
3942+ trace_printf ("Skipping submodule with ignore=all: %s\n" , path );
3943+ trace_printf (" Use -f if you really want to add them." );
3944+ /* Skip this path (submodule ignored) and move on to next diff pair */
3945+ continue ;
39553946 }
39563947 }
39573948 if (add_file_to_index (data -> index , path , data -> flags )) {
0 commit comments