Git fork

Merge branch 'jt/fsck-skiplist-parse-fix'

A misconfigured "fsck.skiplist" configuration variable was not
diagnosed as an error, which has been corrected.

* jt/fsck-skiplist-parse-fix:
fsck: reject misconfigured fsck.skipList

+13 -3
+1 -1
builtin/receive-pack.c
··· 174 174 char *path; 175 175 176 176 if (git_config_pathname(&path, var, value)) 177 - return 1; 177 + return -1; 178 178 strbuf_addf(&fsck_msg_types, "%cskiplist=%s", 179 179 fsck_msg_types.len ? ',' : '=', path); 180 180 free(path);
+1 -1
fetch-pack.c
··· 1867 1867 char *path ; 1868 1868 1869 1869 if (git_config_pathname(&path, var, value)) 1870 - return 0; 1870 + return -1; 1871 1871 strbuf_addf(msg_types, "%cskiplist=%s", 1872 1872 msg_types->len ? ',' : '=', path); 1873 1873 free(path);
+1 -1
fsck.c
··· 1353 1353 struct strbuf sb = STRBUF_INIT; 1354 1354 1355 1355 if (git_config_pathname(&path, var, value)) 1356 - return 1; 1356 + return -1; 1357 1357 strbuf_addf(&sb, "skiplist=%s", path); 1358 1358 free(path); 1359 1359 fsck_set_msg_types(options, sb.buf);
+10
t/t5504-fetch-receive-strict.sh
··· 167 167 168 168 test_expect_success 'fsck with invalid or bogus skipList input' ' 169 169 git -c fsck.skipList=/dev/null -c fsck.missingEmail=ignore fsck && 170 + test_must_fail git -c fsck.skipList -c fsck.missingEmail=ignore fsck 2>err && 171 + test_grep "unable to parse '\'fsck.skiplist\'' from command-line config" err && 170 172 test_must_fail git -c fsck.skipList=does-not-exist -c fsck.missingEmail=ignore fsck 2>err && 171 173 test_grep "could not open.*: does-not-exist" err && 172 174 test_must_fail git -c fsck.skipList=.git/config -c fsck.missingEmail=ignore fsck 2>err && ··· 213 215 test_must_be_empty err 214 216 ' 215 217 218 + test_expect_success 'receive-pack with missing receive.fsck.skipList path' ' 219 + test_must_fail git -c receive.fsck.skipList receive-pack dst 2>err && 220 + test_grep "unable to parse '\'receive.fsck.skiplist\'' from command-line config" err 221 + ' 222 + 216 223 test_expect_success 'push with receive.fsck.skipList' ' 217 224 git push . $commit:refs/heads/bogus && 218 225 rm -rf dst && ··· 255 262 test_must_fail git --git-dir=dst/.git fetch "file://$(pwd)" $refspec && 256 263 257 264 # Invalid and/or bogus skipList input 265 + test_must_fail git --git-dir=dst/.git -c fetch.fsck.skipList fetch \ 266 + "file://$(pwd)" $refspec 2>err && 267 + test_grep "unable to parse '\'fetch.fsck.skiplist\'' from command-line config" err && 258 268 git --git-dir=dst/.git config fetch.fsck.skipList /dev/null && 259 269 test_must_fail git --git-dir=dst/.git fetch "file://$(pwd)" $refspec && 260 270 git --git-dir=dst/.git config fetch.fsck.skipList does-not-exist &&