]> git.ipfire.org Git - thirdparty/git.git/commitdiff
fsck: document that skipList input must be unabbreviated
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Mon, 3 Sep 2018 14:49:23 +0000 (14:49 +0000)
committerJunio C Hamano <gitster@pobox.com>
Wed, 12 Sep 2018 22:17:46 +0000 (15:17 -0700)
Abbreviating the SHA-1s in the skipList input has never worked, but
the documentation hasn't unambiguously stated that this is an error,
and there was no test for it.

Let's fix both since it would be easy for some later refactoring
e.g. switch to accidentally switch to a looser OID parsing function,
causing the tests before this change to pass, but for older versions
of git to be incompatible with the new skipList format.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/config.txt
t/t5504-fetch-receive-strict.sh

index 0e1ce7de8b623501c91761b58b423e3eb2442077..3287c7ef8a973de1b5101560d085828ee9703a16 100644 (file)
@@ -1710,7 +1710,7 @@ doing the same for `receive.fsck.<msg-id>` and `fetch.fsck.<msg-id>`
 will only cause git to warn.
 
 fsck.skipList::
-       The path to a list of object names (i.e. one SHA-1 per
+       The path to a list of object names (i.e. one unabbreviated SHA-1 per
        line) that are known to be broken in a non-fatal way and should
        be ignored. Comments ('#') and empty lines are not supported, and
        will error out.
index 38aaf3b928cff4d3b2e3d516ad1bd6c11e31eb87..96bf9facbdb36002e9b4e4a4248c716ce7c3f71c 100755 (executable)
@@ -190,6 +190,12 @@ test_expect_failure 'fsck no garbage output from comments & empty lines errors'
        test_line_count = 1 err-with-empty-line
 '
 
+test_expect_success 'fsck with invalid abbreviated skipList input' '
+       echo $commit | test_copy_bytes 20 >SKIP.abbreviated &&
+       test_must_fail git -c fsck.skipList=SKIP.abbreviated fsck 2>err-abbreviated &&
+       test_i18ngrep "^fatal: Invalid SHA-1: " err-abbreviated
+'
+
 test_expect_success 'push with receive.fsck.skipList' '
        git push . $commit:refs/heads/bogus &&
        rm -rf dst &&