MCPcopy Index your code
hub / github.com/desktop/desktop / loadCommitBatch

Method loadCommitBatch

app/src/lib/stores/git-store.ts:216–239  ·  view source on GitHub ↗

Load a batch of commits from the repository, using a given commitish object as the starting point

(commitish: string, skip: number)

Source from the content-addressed store, hash-verified

214
215 /** Load a batch of commits from the repository, using a given commitish object as the starting point */
216 public async loadCommitBatch(commitish: string, skip: number) {
217 if (this.requestsInFight.has(LoadingHistoryRequestKey)) {
218 return null
219 }
220
221 const requestKey = `history/compare/${commitish}/skip/${skip}`
222 if (this.requestsInFight.has(requestKey)) {
223 return null
224 }
225
226 this.requestsInFight.add(requestKey)
227
228 const commits = await this.performFailableOperation(() =>
229 getCommits(this.repository, commitish, CommitBatchSize, skip)
230 )
231
232 this.requestsInFight.delete(requestKey)
233 if (!commits) {
234 return null
235 }
236
237 this.storeCommits(commits)
238 return commits.map(c => c.sha)
239 }
240
241 public async refreshTags() {
242 const previousTags = this._localTags

Callers 3

git-store-test.tsFile · 0.80
_executeCompareMethod · 0.80
_loadNextCommitBatchMethod · 0.80

Calls 5

storeCommitsMethod · 0.95
getCommitsFunction · 0.90
addMethod · 0.80
deleteMethod · 0.45

Tested by

no test coverage detected