aboutsummaryrefslogtreecommitdiffstats
path: root/fetch-pack.c
diff options
context:
space:
mode:
authorJustin Tobler <jltobler@gmail.com>2025-01-07 10:29:15 -0600
committerJunio C Hamano <gitster@pobox.com>2025-01-07 09:22:25 -0800
commitca7158076f9f6e0ee1c84595aaf44194a9880a72 (patch)
tree38011f308bcc391b89010260c49a8bb7c7d7ba6d /fetch-pack.c
parentbc2c65770dca70c1d4e151fad971bc7c7235a702 (diff)
downloadgit-ca7158076f9f6e0ee1c84595aaf44194a9880a72.tar.gz
fsck: reject misconfigured fsck.skipList
In Git, fsck operations can ignore known broken objects via the `fsck.skipList` configuration. This option expects a path to a file with the list of object names. When the configuration is specified without a path, an error message is printed, but the command continues as if the configuration was not set. Configuring `fsck.skipList` without a value is a misconfiguration so config parsing should be more strict and reject it. Update `git_fsck_config()` to no longer ignore misconfiguration of `fsck.skipList`. The same behavior is also present for `fetch.fsck.skipList` and `receive.fsck.skipList` so the configuration parsers for these are updated to ensure the related operations remain consistent. Signed-off-by: Justin Tobler <jltobler@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'fetch-pack.c')
-rw-r--r--fetch-pack.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fetch-pack.c b/fetch-pack.c
index 3a227721ed..055e8c3643 100644
--- a/fetch-pack.c
+++ b/fetch-pack.c
@@ -1867,7 +1867,7 @@ int fetch_pack_fsck_config(const char *var, const char *value,
char *path ;
if (git_config_pathname(&path, var, value))
- return 0;
+ return -1;
strbuf_addf(msg_types, "%cskiplist=%s",
msg_types->len ? ',' : '=', path);
free(path);