@@ -959,7 +959,7 @@ enum diff_cmd {
959959 DIFF_FILES
960960};
961961
962- static char * verify_submodule_committish (const char * sm_path ,
962+ static char * verify_submodule_committish (const char * sm_path ,
963963 const char * committish )
964964{
965965 struct child_process cp_rev_parse = CHILD_PROCESS_INIT ;
@@ -979,10 +979,9 @@ static char* verify_submodule_committish(const char *sm_path,
979979 return strbuf_detach (& result , NULL );
980980}
981981
982- static void print_submodule_summary (struct summary_cb * info , char * errmsg ,
982+ static void print_submodule_summary (struct summary_cb * info , char * errmsg ,
983983 int total_commits , const char * displaypath ,
984984 const char * src_abbrev , const char * dst_abbrev ,
985- int missing_src , int missing_dst ,
986985 struct module_cb * p )
987986{
988987 if (p -> status == 'T' ) {
@@ -1036,7 +1035,7 @@ static void print_submodule_summary(struct summary_cb *info, char* errmsg,
10361035static void generate_submodule_summary (struct summary_cb * info ,
10371036 struct module_cb * p )
10381037{
1039- char * displaypath , * src_abbrev , * dst_abbrev ;
1038+ char * displaypath , * src_abbrev = NULL , * dst_abbrev ;
10401039 int missing_src = 0 , missing_dst = 0 ;
10411040 char * errmsg = NULL ;
10421041 int total_commits = -1 ;
@@ -1057,13 +1056,14 @@ static void generate_submodule_summary(struct summary_cb *info,
10571056 } else {
10581057 /* for a submodule removal (mode:0000000), don't warn */
10591058 if (p -> mod_dst )
1060- warning (_ ("unexpected mode %d \n" ), p -> mod_dst );
1059+ warning (_ ("unexpected mode %o \n" ), p -> mod_dst );
10611060 }
10621061 }
10631062
10641063 if (S_ISGITLINK (p -> mod_src )) {
1065- src_abbrev = verify_submodule_committish (p -> sm_path ,
1066- oid_to_hex (& p -> oid_src ));
1064+ if (p -> status != 'D' )
1065+ src_abbrev = verify_submodule_committish (p -> sm_path ,
1066+ oid_to_hex (& p -> oid_src ));
10671067 if (!src_abbrev ) {
10681068 missing_src = 1 ;
10691069 /*
@@ -1154,8 +1154,7 @@ static void generate_submodule_summary(struct summary_cb *info,
11541154
11551155 print_submodule_summary (info , errmsg , total_commits ,
11561156 displaypath , src_abbrev ,
1157- dst_abbrev , missing_src ,
1158- missing_dst , p );
1157+ dst_abbrev , p );
11591158
11601159 free (displaypath );
11611160 free (src_abbrev );
0 commit comments