fix: don't fail on malformed pointer files (#3095)

This commit is contained in:
Erez Rokah
2020-01-15 18:23:42 +02:00
committed by GitHub
parent 7f580db56f
commit 92108431f0
2 changed files with 5 additions and 2 deletions

View File

@ -389,8 +389,11 @@ export default class GitGateway implements Implementation {
return filesPromise
.then(items =>
items.map(({ file: { id }, data }) => {
items.map(({ file: { id, path }, data }) => {
const parsedPointerFile = parsePointerFile(data);
if (!parsedPointerFile.sha) {
console.warn(`Failed parsing pointer file ${path}`);
}
return [
{
pointerId: id,

View File

@ -16,7 +16,7 @@ export const parsePointerFile: (data: string) => PointerFile = flow([
fromPairs,
({ size, oid, ...rest }) => ({
size: parseInt(size),
sha: oid.split(':')[1],
sha: oid?.split(':')[1],
...rest,
}),
]);