@@ -146,6 +146,7 @@ static int opt_parse_porcelain(const struct option *opt, const char *arg, int un
146146static int do_serialize = 0 ;
147147static char * serialize_path = NULL ;
148148
149+ static int reject_implicit = 0 ;
149150static int do_implicit_deserialize = 0 ;
150151static int do_explicit_deserialize = 0 ;
151152static char * deserialize_path = NULL ;
@@ -208,7 +209,7 @@ static int opt_parse_deserialize(const struct option *opt, const char *arg, int
208209 deserialize_path = xstrdup (arg );
209210 }
210211 if (deserialize_path && * deserialize_path
211- && (access (deserialize_path , R_OK ) != 0 ))
212+ && (wt_status_deserialize_access (deserialize_path , R_OK ) != 0 ))
212213 die ("cannot find serialization file '%s'" ,
213214 deserialize_path );
214215
@@ -1414,6 +1415,8 @@ static int git_status_config(const char *k, const char *v, void *cb)
14141415 if (v && * v && access (v , R_OK ) == 0 ) {
14151416 do_implicit_deserialize = 1 ;
14161417 deserialize_path = xstrdup (v );
1418+ } else {
1419+ reject_implicit = 1 ;
14171420 }
14181421 return 0 ;
14191422 }
@@ -1570,6 +1573,17 @@ int cmd_status(int argc, const char **argv, const char *prefix)
15701573 (do_implicit_deserialize || do_explicit_deserialize ));
15711574 if (try_deserialize )
15721575 goto skip_init ;
1576+ /*
1577+ * If we implicitly received a status cache pathname from the config
1578+ * and the file does not exist, we silently reject it and do the normal
1579+ * status "collect". Fake up some trace2 messages to reflect this and
1580+ * assist post-processors know this case is different.
1581+ */
1582+ if (!do_serialize && reject_implicit ) {
1583+ trace2_cmd_mode ("implicit-deserialize" );
1584+ trace2_data_string ("status" , the_repository , "deserialize/reject" ,
1585+ "status-cache/access" );
1586+ }
15731587
15741588 enable_fscache (0 );
15751589 if (status_format != STATUS_FORMAT_PORCELAIN &&
@@ -1613,6 +1627,7 @@ int cmd_status(int argc, const char **argv, const char *prefix)
16131627 if (s .relative_paths )
16141628 s .prefix = prefix ;
16151629
1630+ trace2_cmd_mode ("deserialize" );
16161631 result = wt_status_deserialize (& s , deserialize_path , dw );
16171632 if (result == DESERIALIZE_OK )
16181633 return 0 ;
@@ -1630,6 +1645,7 @@ int cmd_status(int argc, const char **argv, const char *prefix)
16301645 fd = -1 ;
16311646 }
16321647
1648+ trace2_cmd_mode ("collect" );
16331649 wt_status_collect (& s );
16341650
16351651 if (0 <= fd )
@@ -1644,6 +1660,7 @@ int cmd_status(int argc, const char **argv, const char *prefix)
16441660 if (fd_serialize < 0 )
16451661 die_errno (_ ("could not serialize to '%s'" ),
16461662 serialize_path );
1663+ trace2_cmd_mode ("serialize" );
16471664 wt_status_serialize_v1 (fd_serialize , & s );
16481665 close (fd_serialize );
16491666 }
0 commit comments