Skip to content

Commit b01c9cc

Browse files
committed
Adds hack to select head in virtual repos
1 parent 697536e commit b01c9cc

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/plus/github/githubGitProvider.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ import type { LogScope } from '../../logger';
7777
import { Logger } from '../../logger';
7878
import { gate } from '../../system/decorators/gate';
7979
import { debug, getLogScope, log } from '../../system/decorators/log';
80-
import { filterMap, last, some } from '../../system/iterable';
80+
import { filterMap, first, last, some } from '../../system/iterable';
8181
import { isAbsolute, isFolderGlob, maybeUri, normalizePath, relative } from '../../system/path';
8282
import { getSettledValue } from '../../system/promise';
8383
import type { CachedBlame, CachedLog } from '../../trackers/gitDocumentTracker';
@@ -1177,6 +1177,12 @@ export class GitHubGitProvider implements GitProvider, Disposable {
11771177
});
11781178
}
11791179

1180+
if (options?.ref === 'HEAD') {
1181+
options.ref = first(log.commits.values())?.sha;
1182+
} else if (options?.ref != null) {
1183+
options.ref = undefined;
1184+
}
1185+
11801186
return {
11811187
repoPath: repoPath,
11821188
paging: {
@@ -1186,6 +1192,7 @@ export class GitHubGitProvider implements GitProvider, Disposable {
11861192
more: log.hasMore,
11871193
},
11881194
rows: rows,
1195+
sha: options?.ref,
11891196

11901197
more: async (limit: number | { until: string } | undefined): Promise<GitGraph | undefined> => {
11911198
const moreLog = await log.more?.(limit);

0 commit comments

Comments
 (0)