Skip to content

Commit 12b1c50

Browse files
avargitster
authored andcommitted
fsck: document that skipList input must be unabbreviated
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent f706c42 commit 12b1c50

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

Documentation/config.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1710,7 +1710,7 @@ doing the same for `receive.fsck.<msg-id>` and `fetch.fsck.<msg-id>`
17101710
will only cause git to warn.
17111711

17121712
fsck.skipList::
1713-
The path to a list of object names (i.e. one SHA-1 per
1713+
The path to a list of object names (i.e. one unabbreviated SHA-1 per
17141714
line) that are known to be broken in a non-fatal way and should
17151715
be ignored. Comments ('#') and empty lines are not supported, and
17161716
will error out.

t/t5504-fetch-receive-strict.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,12 @@ test_expect_failure 'fsck no garbage output from comments & empty lines errors'
190190
test_line_count = 1 err-with-empty-line
191191
'
192192

193+
test_expect_success 'fsck with invalid abbreviated skipList input' '
194+
echo $commit | test_copy_bytes 20 >SKIP.abbreviated &&
195+
test_must_fail git -c fsck.skipList=SKIP.abbreviated fsck 2>err-abbreviated &&
196+
test_i18ngrep "^fatal: Invalid SHA-1: " err-abbreviated
197+
'
198+
193199
test_expect_success 'push with receive.fsck.skipList' '
194200
git push . $commit:refs/heads/bogus &&
195201
rm -rf dst &&

0 commit comments

Comments
 (0)