MCPcopy Index your code
hub / github.com/git/git / finalize_deferred_config

Function finalize_deferred_config

builtin/commit.c:1256–1293  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1254};
1255
1256static void finalize_deferred_config(struct wt_status *s)
1257{
1258 int use_deferred_config = (status_format != STATUS_FORMAT_PORCELAIN &&
1259 status_format != STATUS_FORMAT_PORCELAIN_V2 &&
1260 !s->null_termination);
1261
1262 if (s->null_termination) {
1263 if (status_format == STATUS_FORMAT_NONE ||
1264 status_format == STATUS_FORMAT_UNSPECIFIED)
1265 status_format = STATUS_FORMAT_PORCELAIN;
1266 else if (status_format == STATUS_FORMAT_LONG)
1267 die(_("options '%s' and '%s' cannot be used together"), "--long", "-z");
1268 }
1269
1270 if (use_deferred_config && status_format == STATUS_FORMAT_UNSPECIFIED)
1271 status_format = status_deferred_config.status_format;
1272 if (status_format == STATUS_FORMAT_UNSPECIFIED)
1273 status_format = STATUS_FORMAT_NONE;
1274
1275 if (use_deferred_config && s->show_branch < 0)
1276 s->show_branch = status_deferred_config.show_branch;
1277 if (s->show_branch < 0)
1278 s->show_branch = 0;
1279
1280 /*
1281 * If the user did not give a "--[no]-ahead-behind" command
1282 * line argument *AND* we will print in a human-readable format
1283 * (short, long etc.) then we inherit from the status.aheadbehind
1284 * config setting. In all other cases (and porcelain V[12] formats
1285 * in particular), we inherit _FULL for backwards compatibility.
1286 */
1287 if (use_deferred_config &&
1288 s->ahead_behind_flags == AHEAD_BEHIND_UNSPECIFIED)
1289 s->ahead_behind_flags = status_deferred_config.ahead_behind;
1290
1291 if (s->ahead_behind_flags == AHEAD_BEHIND_UNSPECIFIED)
1292 s->ahead_behind_flags = AHEAD_BEHIND_FULL;
1293}
1294
1295static void check_fixup_reword_options(int argc, const char *argv[]) {
1296 if (whence != FROM_COMMIT) {

Callers 2

cmd_statusFunction · 0.85

Calls 1

dieFunction · 0.50

Tested by

no test coverage detected