fix: don't fail on malformed pointer files (#3095)
This commit is contained in:
@ -389,8 +389,11 @@ export default class GitGateway implements Implementation {
|
|||||||
|
|
||||||
return filesPromise
|
return filesPromise
|
||||||
.then(items =>
|
.then(items =>
|
||||||
items.map(({ file: { id }, data }) => {
|
items.map(({ file: { id, path }, data }) => {
|
||||||
const parsedPointerFile = parsePointerFile(data);
|
const parsedPointerFile = parsePointerFile(data);
|
||||||
|
if (!parsedPointerFile.sha) {
|
||||||
|
console.warn(`Failed parsing pointer file ${path}`);
|
||||||
|
}
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
pointerId: id,
|
pointerId: id,
|
||||||
|
@ -16,7 +16,7 @@ export const parsePointerFile: (data: string) => PointerFile = flow([
|
|||||||
fromPairs,
|
fromPairs,
|
||||||
({ size, oid, ...rest }) => ({
|
({ size, oid, ...rest }) => ({
|
||||||
size: parseInt(size),
|
size: parseInt(size),
|
||||||
sha: oid.split(':')[1],
|
sha: oid?.split(':')[1],
|
||||||
...rest,
|
...rest,
|
||||||
}),
|
}),
|
||||||
]);
|
]);
|
||||||
|
Reference in New Issue
Block a user