Skip to content

Commit af3544f

Browse files
committed
Update repos.js
1 parent be98043 commit af3544f

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

repos.js

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11

22
// create a repository object
3-
function createRepoObj(fullName, selBranch, pushAccess,
4-
branches, private, isFork, empty) {
3+
function createRepoObj(fullName, selBranch, defaultBranch,
4+
pushAccess, branches, private,
5+
isFork, empty) {
56

67
return {
78
fullName,
89
selBranch,
10+
defaultBranch,
911
pushAccess,
1012
branches,
1113
private,
@@ -42,6 +44,14 @@ function updateModRepoSelectedBranch(fullName, selBranch) {
4244

4345
}
4446

47+
function updateModRepoDefaultBranch(fullName, defaultBranch) {
48+
49+
modifiedRepos[fullName].defaultBranch = defaultBranch;
50+
51+
updateModReposLS();
52+
53+
}
54+
4555
function updateModRepoPushAccess(fullName, pushAccess) {
4656

4757
modifiedRepos[fullName].pushAccess = pushAccess;
@@ -90,7 +100,7 @@ async function fetchRepoAndSaveToModRepos(treeLoc) {
90100

91101
// create temporary repo object
92102
const tempRepoObj = createRepoObj(fullName, selBranch, null,
93-
null, null, null, null);
103+
null, null, null, null, null);
94104

95105
// add temp repo object
96106
// to modified repos
@@ -120,6 +130,8 @@ async function fetchRepoAndSaveToModRepos(treeLoc) {
120130

121131
(tempRepo.selBranch ?? repo.default_branch),
122132

133+
repo.default_branch,
134+
123135
(tempRepo.pushAccess ?? ((repo.permissions && repo.permissions.push) ?? false)),
124136

125137
(tempRepo.branches ?? null),

0 commit comments

Comments
 (0)