Skip to content

Commit

Permalink
fix: don't fail on malformed pointer files (#3095)
Browse files Browse the repository at this point in the history
  • Loading branch information
erezrokah committed Jan 15, 2020
1 parent 7f580db commit 9210843
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}),
]);
Expand Down

0 comments on commit 9210843

Please sign in to comment.