static int upload_pack_config(const char *var, const char *value, void *unused) { if (!strcmp("uploadpack.allowtipsha1inwant", var)) { if (git_config_bool(var, value)) allow_unadvertised_object_request |= ALLOW_TIP_SHA1; else allow_unadvertised_object_request &= ~ALLOW_TIP_SHA1; } else if (!strcmp("uploadpack.allowreachablesha1inwant", var)) { if (git_config_bool(var, value)) allow_unadvertised_object_request |= ALLOW_REACHABLE_SHA1; else allow_unadvertised_object_request &= ~ALLOW_REACHABLE_SHA1; } else if (!strcmp("uploadpack.allowanysha1inwant", var)) { if (git_config_bool(var, value)) allow_unadvertised_object_request |= ALLOW_ANY_SHA1; else allow_unadvertised_object_request &= ~ALLOW_ANY_SHA1; } else if (!strcmp("uploadpack.keepalive", var)) { keepalive = git_config_int(var, value); if (!keepalive) keepalive = -1; } else if (current_config_scope() != CONFIG_SCOPE_REPO) { if (!strcmp("uploadpack.packobjectshook", var)) return git_config_string(&pack_objects_hook, var, value); } else if (!strcmp("uploadpack.allowfilter", var)) { allow_filter = git_config_bool(var, value); } return parse_hide_refs_config(var, value, "uploadpack"); }
static int upload_pack_config(const char *var, const char *value, void *unused) { if (!strcmp("uploadpack.allowtipsha1inwant", var)) allow_tip_sha1_in_want = git_config_bool(var, value); else if (!strcmp("uploadpack.keepalive", var)) { keepalive = git_config_int(var, value); if (!keepalive) keepalive = -1; } return parse_hide_refs_config(var, value, "uploadpack"); }
static int upload_pack_config(const char *var, const char *value, void *unused) { if (!strcmp("uploadpack.allowtipsha1inwant", var)) { if (git_config_bool(var, value)) allow_unadvertised_object_request |= ALLOW_TIP_SHA1; else allow_unadvertised_object_request &= ~ALLOW_TIP_SHA1; } else if (!strcmp("uploadpack.allowreachablesha1inwant", var)) { if (git_config_bool(var, value)) allow_unadvertised_object_request |= ALLOW_REACHABLE_SHA1; else allow_unadvertised_object_request &= ~ALLOW_REACHABLE_SHA1; } else if (!strcmp("uploadpack.keepalive", var)) { keepalive = git_config_int(var, value); if (!keepalive) keepalive = -1; } return parse_hide_refs_config(var, value, "uploadpack"); }
static int receive_pack_config(const char *var, const char *value, void *cb) { int status = parse_hide_refs_config(var, value, "receive"); if (status) return status; if (strcmp(var, "receive.denydeletes") == 0) { deny_deletes = git_config_bool(var, value); return 0; } if (strcmp(var, "receive.denynonfastforwards") == 0) { deny_non_fast_forwards = git_config_bool(var, value); return 0; } if (strcmp(var, "receive.unpacklimit") == 0) { receive_unpack_limit = git_config_int(var, value); return 0; } if (strcmp(var, "transfer.unpacklimit") == 0) { transfer_unpack_limit = git_config_int(var, value); return 0; } if (strcmp(var, "receive.fsckobjects") == 0) { receive_fsck_objects = git_config_bool(var, value); return 0; } if (strcmp(var, "transfer.fsckobjects") == 0) { transfer_fsck_objects = git_config_bool(var, value); return 0; } if (!strcmp(var, "receive.denycurrentbranch")) { deny_current_branch = parse_deny_action(var, value); return 0; } if (strcmp(var, "receive.denydeletecurrent") == 0) { deny_delete_current = parse_deny_action(var, value); return 0; } if (strcmp(var, "repack.usedeltabaseoffset") == 0) { prefer_ofs_delta = git_config_bool(var, value); return 0; } if (strcmp(var, "receive.updateserverinfo") == 0) { auto_update_server_info = git_config_bool(var, value); return 0; } if (strcmp(var, "receive.autogc") == 0) { auto_gc = git_config_bool(var, value); return 0; } return git_default_config(var, value, cb); }
static int receive_pack_config(const char *var, const char *value, void *cb) { int status = parse_hide_refs_config(var, value, "receive"); if (status) return status; if (strcmp(var, "receive.denydeletes") == 0) { deny_deletes = git_config_bool(var, value); return 0; } if (strcmp(var, "receive.denynonfastforwards") == 0) { deny_non_fast_forwards = git_config_bool(var, value); return 0; } if (strcmp(var, "receive.unpacklimit") == 0) { receive_unpack_limit = git_config_int(var, value); return 0; } if (strcmp(var, "transfer.unpacklimit") == 0) { transfer_unpack_limit = git_config_int(var, value); return 0; } if (strcmp(var, "receive.fsck.skiplist") == 0) { const char *path; if (git_config_pathname(&path, var, value)) return 1; strbuf_addf(&fsck_msg_types, "%cskiplist=%s", fsck_msg_types.len ? ',' : '=', path); free((char *)path); return 0; } if (skip_prefix(var, "receive.fsck.", &var)) { if (is_valid_msg_type(var, value)) strbuf_addf(&fsck_msg_types, "%c%s=%s", fsck_msg_types.len ? ',' : '=', var, value); else warning("Skipping unknown msg id '%s'", var); return 0; } if (strcmp(var, "receive.fsckobjects") == 0) { receive_fsck_objects = git_config_bool(var, value); return 0; } if (strcmp(var, "transfer.fsckobjects") == 0) { transfer_fsck_objects = git_config_bool(var, value); return 0; } if (!strcmp(var, "receive.denycurrentbranch")) { deny_current_branch = parse_deny_action(var, value); return 0; } if (strcmp(var, "receive.denydeletecurrent") == 0) { deny_delete_current = parse_deny_action(var, value); return 0; } if (strcmp(var, "repack.usedeltabaseoffset") == 0) { prefer_ofs_delta = git_config_bool(var, value); return 0; } if (strcmp(var, "receive.updateserverinfo") == 0) { auto_update_server_info = git_config_bool(var, value); return 0; } if (strcmp(var, "receive.autogc") == 0) { auto_gc = git_config_bool(var, value); return 0; } if (strcmp(var, "receive.shallowupdate") == 0) { shallow_update = git_config_bool(var, value); return 0; } if (strcmp(var, "receive.certnonceseed") == 0) return git_config_string(&cert_nonce_seed, var, value); if (strcmp(var, "receive.certnonceslop") == 0) { nonce_stamp_slop_limit = git_config_ulong(var, value); return 0; } if (strcmp(var, "receive.advertiseatomic") == 0) { advertise_atomic_push = git_config_bool(var, value); return 0; } if (strcmp(var, "receive.advertisepushoptions") == 0) { advertise_push_options = git_config_bool(var, value); return 0; } if (strcmp(var, "receive.keepalive") == 0) { keepalive_in_sec = git_config_int(var, value); return 0; } return git_default_config(var, value, cb); }