char *path;
if (git_config_pathname(&path, var, value))
- return 1;
+ return -1;
strbuf_addf(&fsck_msg_types, "%cskiplist=%s",
fsck_msg_types.len ? ',' : '=', path);
free(path);
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);
struct strbuf sb = STRBUF_INIT;
if (git_config_pathname(&path, var, value))
- return 1;
+ return -1;
strbuf_addf(&sb, "skiplist=%s", path);
free(path);
fsck_set_msg_types(options, sb.buf);
test_expect_success 'fsck with invalid or bogus skipList input' '
git -c fsck.skipList=/dev/null -c fsck.missingEmail=ignore fsck &&
+ test_must_fail git -c fsck.skipList -c fsck.missingEmail=ignore fsck 2>err &&
+ test_grep "unable to parse '\'fsck.skiplist\'' from command-line config" err &&
test_must_fail git -c fsck.skipList=does-not-exist -c fsck.missingEmail=ignore fsck 2>err &&
test_grep "could not open.*: does-not-exist" err &&
test_must_fail git -c fsck.skipList=.git/config -c fsck.missingEmail=ignore fsck 2>err &&
test_must_be_empty err
'
+test_expect_success 'receive-pack with missing receive.fsck.skipList path' '
+ test_must_fail git -c receive.fsck.skipList receive-pack dst 2>err &&
+ test_grep "unable to parse '\'receive.fsck.skiplist\'' from command-line config" err
+'
+
test_expect_success 'push with receive.fsck.skipList' '
git push . $commit:refs/heads/bogus &&
rm -rf dst &&
test_must_fail git --git-dir=dst/.git fetch "file://$(pwd)" $refspec &&
# Invalid and/or bogus skipList input
+ test_must_fail git --git-dir=dst/.git -c fetch.fsck.skipList fetch \
+ "file://$(pwd)" $refspec 2>err &&
+ test_grep "unable to parse '\'fetch.fsck.skiplist\'' from command-line config" err &&
git --git-dir=dst/.git config fetch.fsck.skipList /dev/null &&
test_must_fail git --git-dir=dst/.git fetch "file://$(pwd)" $refspec &&
git --git-dir=dst/.git config fetch.fsck.skipList does-not-exist &&