diff --git a/src/env/node/git/localGitProvider.ts b/src/env/node/git/localGitProvider.ts index a7dbb41..1a5b2d7 100644 --- a/src/env/node/git/localGitProvider.ts +++ b/src/env/node/git/localGitProvider.ts @@ -2395,7 +2395,7 @@ export class LocalGitProvider implements GitProvider, Disposable { limit: moreLimit === 0 ? 0 : (options?.limit ?? 0) + moreLimit, }); // If we can't find any more, assume we have everything - if (moreLog == null) return { ...log, hasMore: false }; + if (moreLog == null) return { ...log, hasMore: false, more: undefined }; return moreLog; } @@ -2418,7 +2418,7 @@ export class LocalGitProvider implements GitProvider, Disposable { : { ref: moreUntil == null ? `${ref}^` : `${moreUntil}^..${ref}^` }), }); // If we can't find any more, assume we have everything - if (moreLog == null) return { ...log, hasMore: false }; + if (moreLog == null) return { ...log, hasMore: false, more: undefined }; const commits = new Map([...log.commits, ...moreLog.commits]); @@ -2441,7 +2441,9 @@ export class LocalGitProvider implements GitProvider, Disposable { }, query: (limit: number | undefined) => this.getLog(log.repoPath, { ...options, limit: limit }), }; - mergedLog.more = this.getLogMoreFn(mergedLog, options); + if (mergedLog.hasMore) { + mergedLog.more = this.getLogMoreFn(mergedLog, options); + } return mergedLog; }; @@ -2583,7 +2585,7 @@ export class LocalGitProvider implements GitProvider, Disposable { skip: log.count, }); // If we can't find any more, assume we have everything - if (moreLog == null) return { ...log, hasMore: false }; + if (moreLog == null) return { ...log, hasMore: false, more: undefined }; const commits = new Map([...log.commits, ...moreLog.commits]); @@ -2598,7 +2600,9 @@ export class LocalGitProvider implements GitProvider, Disposable { query: (limit: number | undefined) => this.getLogForSearch(log.repoPath, search, { ...options, limit: limit }), }; - mergedLog.more = this.getLogForSearchMoreFn(mergedLog, search, options); + if (mergedLog.hasMore) { + mergedLog.more = this.getLogForSearchMoreFn(mergedLog, search, options); + } return mergedLog; }; @@ -2871,7 +2875,7 @@ export class LocalGitProvider implements GitProvider, Disposable { skip: options.all ? log.count : undefined, }); // If we can't find any more, assume we have everything - if (moreLog == null) return { ...log, hasMore: false }; + if (moreLog == null) return { ...log, hasMore: false, more: undefined }; const commits = new Map([...log.commits, ...moreLog.commits]); @@ -2895,7 +2899,9 @@ export class LocalGitProvider implements GitProvider, Disposable { relativePath = renamed?.file?.originalPath ?? relativePath; } - mergedLog.more = this.getLogForFileMoreFn(mergedLog, relativePath, options); + if (mergedLog.hasMore) { + mergedLog.more = this.getLogForFileMoreFn(mergedLog, relativePath, options); + } return mergedLog; }; @@ -3442,7 +3448,7 @@ export class LocalGitProvider implements GitProvider, Disposable { }); if (moreLog == null) { // If we can't find any more, assume we have everything - return { ...reflog, hasMore: false }; + return { ...reflog, hasMore: false, more: undefined }; } const mergedLog: GitReflog = { @@ -3453,7 +3459,9 @@ export class LocalGitProvider implements GitProvider, Disposable { limit: (reflog.limit ?? 0) + limit, hasMore: moreLog.hasMore, }; - mergedLog.more = this.getReflogMoreFn(mergedLog, options); + if (mergedLog.hasMore) { + mergedLog.more = this.getReflogMoreFn(mergedLog, options); + } return mergedLog; }; diff --git a/src/plus/github/githubGitProvider.ts b/src/plus/github/githubGitProvider.ts index cbaded9..e13aa7b 100644 --- a/src/plus/github/githubGitProvider.ts +++ b/src/plus/github/githubGitProvider.ts @@ -1471,7 +1471,7 @@ export class GitHubGitProvider implements GitProvider, Disposable { // limit: moreLimit === 0 ? 0 : (options?.limit ?? 0) + moreLimit, // }); // // If we can't find any more, assume we have everything - // if (moreLog == null) return { ...log, hasMore: false }; + // if (moreLog == null) return { ...log, hasMore: false, more: undefined }; // return moreLog; // } @@ -1483,7 +1483,7 @@ export class GitHubGitProvider implements GitProvider, Disposable { // ref: moreUntil == null ? `${ref}^` : `${moreUntil}^..${ref}^`, // }); // // If we can't find any more, assume we have everything - // if (moreLog == null) return { ...log, hasMore: false }; + // if (moreLog == null) return { ...log, hasMore: false, more: undefined }; const moreLog = await this.getLog(log.repoPath, { ...options, @@ -1491,7 +1491,7 @@ export class GitHubGitProvider implements GitProvider, Disposable { cursor: log.endingCursor, }); // If we can't find any more, assume we have everything - if (moreLog == null) return { ...log, hasMore: false }; + if (moreLog == null) return { ...log, hasMore: false, more: undefined }; const commits = new Map([...log.commits, ...moreLog.commits]); @@ -1514,7 +1514,9 @@ export class GitHubGitProvider implements GitProvider, Disposable { }, query: log.query, }; - mergedLog.more = this.getLogMoreFn(mergedLog, options); + if (mergedLog.hasMore) { + mergedLog.more = this.getLogMoreFn(mergedLog, options); + } return mergedLog; }; @@ -1688,7 +1690,7 @@ export class GitHubGitProvider implements GitProvider, Disposable { cursor: log.endingCursor, }); // If we can't find any more, assume we have everything - if (moreLog == null) return { ...log, hasMore: false }; + if (moreLog == null) return { ...log, hasMore: false, more: undefined }; const commits = new Map([...log.commits, ...moreLog.commits]); @@ -1703,7 +1705,9 @@ export class GitHubGitProvider implements GitProvider, Disposable { endingCursor: moreLog.endingCursor, query: log.query, }; - mergedLog.more = this.getLogForSearchMoreFn(mergedLog, search, options); + if (mergedLog.hasMore) { + mergedLog.more = this.getLogForSearchMoreFn(mergedLog, search, options); + } return mergedLog; }; @@ -1984,7 +1988,6 @@ export class GitHubGitProvider implements GitProvider, Disposable { endingCursor: result.paging?.cursor, query: (limit: number | undefined) => this.getLogForFile(repoPath, path, { ...options, limit: limit }), }; - if (log.hasMore) { log.more = this.getLogForFileMoreFn(log, path, options); } @@ -2042,7 +2045,7 @@ export class GitHubGitProvider implements GitProvider, Disposable { // skip: options.all ? log.count : undefined, }); // If we can't find any more, assume we have everything - if (moreLog == null) return { ...log, hasMore: false }; + if (moreLog == null) return { ...log, hasMore: false, more: undefined }; const commits = new Map([...log.commits, ...moreLog.commits]); @@ -2066,7 +2069,9 @@ export class GitHubGitProvider implements GitProvider, Disposable { // fileName = renamed?.file?.originalPath ?? fileName; // } - mergedLog.more = this.getLogForFileMoreFn(mergedLog, relativePath, options); + if (mergedLog.hasMore) { + mergedLog.more = this.getLogForFileMoreFn(mergedLog, relativePath, options); + } return mergedLog; };