Skip to content

Commit 0238044

Browse files
author
Steven Nagie
committed
Updated BaseRepository to include default branch, adding default branch in gitlab, setting repo to be reindexed if default branch changes
1 parent b3e86a7 commit 0238044

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

packages/backend/src/gitlab.ts

+1
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ export const getGitLabReposFromConfig = async (config: GitLabConfig, ctx: AppCon
114114
cloneUrl: cloneUrl.toString(),
115115
path: repoPath,
116116
isStale: false,
117+
defaultBranch: project.default_branch,
117118
isFork,
118119
isArchived: project.archived,
119120
topics: project.topics ?? [],

packages/backend/src/main.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,8 @@ export const isRepoReindexingRequired = (previous: Repository, current: Reposito
154154

155155
return (
156156
!arraysEqualShallow(previous.branches, current.branches) ||
157-
!arraysEqualShallow(previous.tags, current.tags)
157+
!arraysEqualShallow(previous.tags, current.tags) ||
158+
previous.defaultBranch !== current.defaultBranch
158159
);
159160
}
160161

packages/backend/src/types.ts

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ interface BaseRepository {
1010
codeHost?: string;
1111
topics?: string[];
1212
sizeInBytes?: number;
13+
defaultBranch: string;
1314
}
1415

1516
export interface GitRepository extends BaseRepository {

0 commit comments

Comments
 (0)