| 184 | } |
| 185 | |
| 186 | void fsm_settings__set_hook(struct repository *r, const char *path) |
| 187 | { |
| 188 | enum fsmonitor_reason reason = check_for_incompatible(r, 0); |
| 189 | |
| 190 | if (reason != FSMONITOR_REASON_OK) { |
| 191 | fsm_settings__set_incompatible(r, reason); |
| 192 | return; |
| 193 | } |
| 194 | |
| 195 | /* |
| 196 | * Caller requested hook explicitly, so avoid (possibly |
| 197 | * recursive) config lookup. |
| 198 | */ |
| 199 | if (!r->settings.fsmonitor) |
| 200 | r->settings.fsmonitor = alloc_settings(); |
| 201 | |
| 202 | r->settings.fsmonitor->mode = FSMONITOR_MODE_HOOK; |
| 203 | r->settings.fsmonitor->reason = reason; |
| 204 | FREE_AND_NULL(r->settings.fsmonitor->hook_path); |
| 205 | r->settings.fsmonitor->hook_path = strdup(path); |
| 206 | } |
| 207 | |
| 208 | void fsm_settings__set_disabled(struct repository *r) |
| 209 | { |
no test coverage detected