Skip to content

Commit cfa56bc

Browse files
committed
nit + delete fairly useless test
1 parent 92ab07a commit cfa56bc

File tree

2 files changed

+3
-23
lines changed

2 files changed

+3
-23
lines changed

src/github/githubRepository.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1343,12 +1343,12 @@ export class GitHubRepository extends Disposable {
13431343
return data.repository?.ref?.target.oid;
13441344
}
13451345

1346-
private static branchesCacheKey(owner: string, repositoryName: string): string {
1346+
private branchesCacheKey(owner: string, repositoryName: string): string {
13471347
return `${owner}/${repositoryName}`;
13481348
}
13491349

13501350
getCachedBranches(owner: string, repositoryName: string): string[] | undefined {
1351-
return this._branchesCache.get(GitHubRepository.branchesCacheKey(owner, repositoryName));
1351+
return this._branchesCache.get(this.branchesCacheKey(owner, repositoryName));
13521352
}
13531353

13541354
async listBranches(owner: string, repositoryName: string, prefix: string | undefined): Promise<string[]> {
@@ -1394,7 +1394,7 @@ export class GitHubRepository extends Disposable {
13941394
}
13951395
// Cache results for unprefixed queries
13961396
if (!prefix) {
1397-
this._branchesCache.set(GitHubRepository.branchesCacheKey(owner, repositoryName), branches);
1397+
this._branchesCache.set(this.branchesCacheKey(owner, repositoryName), branches);
13981398
}
13991399
return branches;
14001400
}

src/test/github/githubRepository.test.ts

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -52,24 +52,4 @@ describe('GitHubRepository', function () {
5252
// assert(! dotcomRepository.isGitHubDotCom);
5353
});
5454
});
55-
56-
describe('getCachedBranches', function () {
57-
it('returns undefined when no branches have been cached', function () {
58-
const url = 'https://github.com/owner/repo';
59-
const remote = new GitHubRemote('origin', url, new Protocol(url), GitHubServerType.GitHubDotCom);
60-
const rootUri = Uri.file('C:\\users\\test\\repo');
61-
const repo = new GitHubRepository(1, remote, rootUri, credentialStore, telemetry);
62-
63-
assert.strictEqual(repo.getCachedBranches('owner', 'repo'), undefined);
64-
});
65-
66-
it('returns undefined for an owner/repo with no cache entry', function () {
67-
const url = 'https://github.com/owner/repo';
68-
const remote = new GitHubRemote('origin', url, new Protocol(url), GitHubServerType.GitHubDotCom);
69-
const rootUri = Uri.file('C:\\users\\test\\repo');
70-
const repo = new GitHubRepository(1, remote, rootUri, credentialStore, telemetry);
71-
72-
assert.strictEqual(repo.getCachedBranches('other-owner', 'other-repo'), undefined);
73-
});
74-
});
7555
});

0 commit comments

Comments
 (0)