summaryrefslogtreecommitdiff
path: root/builtin/fsck.c
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2015-06-22 15:27:23 (GMT)
committerJunio C Hamano <gitster@pobox.com>2015-06-23 21:27:37 (GMT)
commit1335f732892601368876e0e41c9ea288c2ab18f3 (patch)
treea6672a458f7a39c7333273e1b336862291be9d3c /builtin/fsck.c
parentcd94c6f91ee92ffb0592696170fa84f426b839ab (diff)
downloadgit-1335f732892601368876e0e41c9ea288c2ab18f3.zip
git-1335f732892601368876e0e41c9ea288c2ab18f3.tar.gz
git-1335f732892601368876e0e41c9ea288c2ab18f3.tar.bz2
fsck: support ignoring objects in `git fsck` via fsck.skiplist
Identical to support in `git receive-pack for the config option `receive.fsck.skiplist`, we now support ignoring given objects in `git fsck` via `fsck.skiplist` altogether. This is extremely handy in case of legacy repositories where it would cause more pain to change incorrect objects than to live with them (e.g. a duplicate 'author' line in an early commit object). Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/fsck.c')
-rw-r--r--builtin/fsck.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/builtin/fsck.c b/builtin/fsck.c
index 070909e..67237a6 100644
--- a/builtin/fsck.c
+++ b/builtin/fsck.c
@@ -49,6 +49,19 @@ static int show_dangling = 1;
static int fsck_config(const char *var, const char *value, void *cb)
{
+ if (strcmp(var, "fsck.skiplist") == 0) {
+ const char *path;
+ struct strbuf sb = STRBUF_INIT;
+
+ if (git_config_pathname(&path, var, value))
+ return 1;
+ strbuf_addf(&sb, "skiplist=%s", path);
+ free((char *)path);
+ fsck_set_msg_types(&fsck_obj_options, sb.buf);
+ strbuf_release(&sb);
+ return 0;
+ }
+
if (skip_prefix(var, "fsck.", &var)) {
fsck_set_msg_type(&fsck_obj_options, var, value);
return 0;