Merge branch 'jn/fsck-ident'
* jn/fsck-ident: fsck: fix bogus commit header check
This commit is contained in:
commit
004ae6cbd0
2
fsck.c
2
fsck.c
@ -311,8 +311,6 @@ static int fsck_commit(struct commit *commit, fsck_error error_func)
|
|||||||
err = fsck_ident(&buffer, &commit->object, error_func);
|
err = fsck_ident(&buffer, &commit->object, error_func);
|
||||||
if (err)
|
if (err)
|
||||||
return err;
|
return err;
|
||||||
if (*buffer != '\n')
|
|
||||||
return error_func(&commit->object, FSCK_ERROR, "invalid format - expected blank line");
|
|
||||||
if (!commit->tree)
|
if (!commit->tree)
|
||||||
return error_func(&commit->object, FSCK_ERROR, "could not load commit's tree %s", sha1_to_hex(tree_sha1));
|
return error_func(&commit->object, FSCK_ERROR, "could not load commit's tree %s", sha1_to_hex(tree_sha1));
|
||||||
|
|
||||||
|
@ -5,7 +5,9 @@ test_description='git fsck random collection of tests'
|
|||||||
. ./test-lib.sh
|
. ./test-lib.sh
|
||||||
|
|
||||||
test_expect_success setup '
|
test_expect_success setup '
|
||||||
|
git config i18n.commitencoding ISO-8859-1 &&
|
||||||
test_commit A fileA one &&
|
test_commit A fileA one &&
|
||||||
|
git config --unset i18n.commitencoding &&
|
||||||
git checkout HEAD^0 &&
|
git checkout HEAD^0 &&
|
||||||
test_commit B fileB two &&
|
test_commit B fileB two &&
|
||||||
git tag -d A B &&
|
git tag -d A B &&
|
||||||
@ -28,6 +30,12 @@ test_expect_success 'loose objects borrowed from alternate are not missing' '
|
|||||||
)
|
)
|
||||||
'
|
'
|
||||||
|
|
||||||
|
test_expect_success 'valid objects appear valid' '
|
||||||
|
{ git fsck 2>out; true; } &&
|
||||||
|
! grep error out &&
|
||||||
|
! grep fatal out
|
||||||
|
'
|
||||||
|
|
||||||
# Corruption tests follow. Make sure to remove all traces of the
|
# Corruption tests follow. Make sure to remove all traces of the
|
||||||
# specific corruption you test afterwards, lest a later test trip over
|
# specific corruption you test afterwards, lest a later test trip over
|
||||||
# it.
|
# it.
|
||||||
|
Loading…
Reference in New Issue
Block a user