backend-common: Support SHA based caching in URL Reader's readTree

readTree now takes a SHA in options, and throws a NotModifiedError if the SHA matches with the latest commit SHA on the tree. readTree response now contains a new 'sha' parameter.

Also, the default branch will now be used if no branch is provided in the url's target
This commit is contained in:
Himanshu Mishra
2021-01-16 22:10:43 +01:00
parent 4211198c30
commit 2305296073
16 changed files with 305 additions and 167 deletions
@@ -135,6 +135,7 @@ describe('getDocFilesFromRepository', () => {
archive: async () => {
return Readable.from('');
},
sha: '',
};
}
}