diff options
author | Patrick Steinhardt <psteinhardt@gitlab.com> | 2021-11-09 11:04:52 +0300 |
---|---|---|
committer | Patrick Steinhardt <psteinhardt@gitlab.com> | 2021-11-09 11:46:56 +0300 |
commit | db8f2e8da5e7ff9cf84a99195481303016cd2138 (patch) | |
tree | 3c8267cf4909291a7fe6a64ec65a5336b637bfe9 /internal/git/command_description.go | |
parent | 8388b2f6bc09973476e3b2e1f3bfbff89869f877 (diff) |
git: Ignore fsck errors for zero-padded filemodes
When receiving objects, Git by defaults verifies that all objects pass a
range of consistency checks such that the repository doesn't end up in a
corrupt state. While some of these checks are important, others check
for formatting issues in the Git objects which used to be misformatted
by some implementations of Git. Given that histories are immutable
though, some repositories do have such misformatted objects and cannot
really do anything about them, which is why we selectively disable some
consistency checks for issues we encounter and think to be benign.
We have received several reports about failing consistency checks when
the objects contain trees which have zero-padded filemodes. That is,
instead of directory entries having the mode "4000", they instead have a
mode of "040000", which is wrong. Git handles parsing these objects just
fine though, so it's a harmless warning.
Ignore errors about zero-padded filemodes such that it becomes possible
to push them into repos again.
Changelog: changed
Diffstat (limited to 'internal/git/command_description.go')
-rw-r--r-- | internal/git/command_description.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/internal/git/command_description.go b/internal/git/command_description.go index 10acf6c8d..8154eed98 100644 --- a/internal/git/command_description.go +++ b/internal/git/command_description.go @@ -388,6 +388,12 @@ func fsckConfiguration(prefix string) []GlobalOption { // enough and we cope just fine parsing such signatures, so we can // ignore this error. "fsck.missingSpaceBeforeDate": "ignore", + + // Oldish Git versions used to zero-pad some filemodes, e.g. instead of a + // file mode of 40000 the tree object would have endcoded the filemode as + // 04000. This doesn't cause any and Git can cope with it alright, so let's + // ignore it. + "fsck.zeroPaddedFilemode": "ignore", } { configPairs = append(configPairs, ConfigPair{ Key: fmt.Sprintf("%s.%s", prefix, key), |