MCPcopy Create free account
hub / github.com/git/git / fsm_settings__set_hook

Function fsm_settings__set_hook

fsmonitor-settings.c:186–206  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

184}
185
186void 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
208void fsm_settings__set_disabled(struct repository *r)
209{

Callers 1

Calls 3

check_for_incompatibleFunction · 0.85
alloc_settingsFunction · 0.85

Tested by

no test coverage detected