Skip to content

Commit

Permalink
refactor: remove gitConflicts (#18576)
Browse files Browse the repository at this point in the history
  • Loading branch information
RahulGautamSingh committed Nov 10, 2022
1 parent 569f5fb commit a613692
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 33 deletions.
2 changes: 0 additions & 2 deletions lib/util/cache/repository/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import type {
} from '../../../config/types';
import type { PackageFile } from '../../../modules/manager/types';
import type { RepoInitConfig } from '../../../workers/repository/init/types';
import type { GitConflictsCache } from '../../git/types';

export interface BaseBranchCache {
sha: string; // branch commit sha
Expand Down Expand Up @@ -87,7 +86,6 @@ export interface RepoCacheData {
platform?: {
github?: Record<string, unknown>;
};
gitConflicts?: GitConflictsCache;
prComments?: Record<number, Record<string, string>>;
}

Expand Down
13 changes: 0 additions & 13 deletions lib/util/git/conflicts-cache.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,19 +97,6 @@ describe('util/git/conflicts-cache', () => {
getCachedConflictResult('foo', 'sha', 'bar', 'base_sha')
).toBeTrue();
});

it('deletes old cache', () => {
repoCache.gitConflicts = {
foo: {
targetBranchSha: '111',
sourceBranches: {
bar: { sourceBranchSha: '222', isConflicted: true },
},
},
};
getCachedConflictResult('foo', '111', 'bar', '222');
expect(repoCache.gitConflicts).toBeUndefined();
});
});

describe('setCachedConflictResult', () => {
Expand Down
4 changes: 0 additions & 4 deletions lib/util/git/conflicts-cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ export function getCachedConflictResult(
baseBranchSha: string
): boolean | null {
const cache = getCache();
if (cache.gitConflicts) {
delete cache.gitConflicts;
}

const branch = cache?.branches?.find((br) => br.branchName === branchName);
if (
branch &&
Expand Down
14 changes: 0 additions & 14 deletions lib/util/git/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,20 +79,6 @@ export interface CommitFilesConfig {
}

export type BranchName = string;
export type TargetBranchName = BranchName;
export type SourceBranchName = BranchName;

export type GitConflictsCache = Record<TargetBranchName, TargetBranchConflicts>;

export interface TargetBranchConflicts {
targetBranchSha: CommitSha;
sourceBranches: Record<SourceBranchName, SourceBranchConflict>;
}

export interface SourceBranchConflict {
sourceBranchSha: CommitSha;
isConflicted: boolean;
}

export interface CommitResult {
parentCommitSha: string;
Expand Down

0 comments on commit a613692

Please sign in to comment.