fix(backend-gitlab): exclude directories in paginated results (#2668)

This commit is contained in:
Bartholomew 2019-09-10 16:31:53 +01:00 committed by Shawn Erquhart
parent ee161c6848
commit 3903acb431

View File

@ -203,7 +203,10 @@ export default class API {
traverseCursor = async (cursor, action) => { traverseCursor = async (cursor, action) => {
const link = cursor.data.getIn(['links', action]); const link = cursor.data.getIn(['links', action]);
const { entries, cursor: newCursor } = await this.fetchCursorAndEntries(link); const { entries, cursor: newCursor } = await this.fetchCursorAndEntries(link);
return { entries: entries.reverse(), cursor: this.reverseCursor(newCursor) }; return {
entries: entries.filter(({ type }) => type === 'blob').reverse(),
cursor: this.reverseCursor(newCursor),
};
}; };
listAllFiles = async path => { listAllFiles = async path => {